![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm tryring to use berkeleydb on a single database across multiple machines. Each machine also has multiple processes reading/updating the database. The database file is mounted over NFS. Each process on each machine is locking the database file after it opens it, performs its reads/writes and then unlocks the file before closing it. I'm using CDB while opening environements on individual machines. But occasionally, I get an error 'DB_RUNRECOVERY: Fatal error, run database recovery' on one of the machines while calling DB->put(). How can I ensure database file integrity across multiple machines over a remote filesystem, inspite of locking the database file before reading/updating it. |
#3
| |||
| |||
|
|
Each process on each machine is locking the database file after it opens it, performs its reads/writes and then unlocks the file before closing it. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
i) Create a .lck file on the remote FS and lock it. ii) Create a DB environment. iii) Open the environment using DB_JOINENV (as multiple processes exist, iv) Create a DB handle v) Open the DB database file vi) Perform reads/updates vii) Close the DB database file viii) Close the DB handle ix) Close the DB environment x) Close the .lck file (Closing it should release all locks on it) So now, multiple processes, whether on the same machine or across different machines should stall on step i) untill the .lck file is unlocked. (Locking the DB database file should now be irrelevant) But I'm still getting a DB_RUNRECOVERY error during a DB->put() in step vi). This does not happen immediately, but generally seems to occur when the database file size is around 3~4MB. |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |