[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: BDB memory cache problem

Szuts Attila wrote:

Is there any way to turn off BDB memory_cacheing_to_disk ?
(__db.001 and other files) At least for write operations?

Most of the times this files causes data loss, when OS system crashes.
If I unterstand it right: 1. BDB waiting until memory buffer is full, 2. then write data to disk I/O buffer

The BDB cache resides in memory-mapped files by default. So there is no step 2, all writes to the memory buffer are automatically paged to disk by the operating system.

3. then will be written data to *.bdb files.
Between 1 and 2 data is written to log.000000* file, but after OS recovering there is always some data I can't read.

If OS fails and BDB memory buffer is not flushed, then data will loss. As I see this is persistent problem in BDB over the time.

That's what the db_recover command is for, to replay events from the log files back into the database.

 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support