Closed cmumford closed 8 years ago
Comment #1 originally posted by wuzuyang on 2013-09-16T04:59:49.000Z:
I think LevelDB should not use mmap, it is easy to lost data on power failure, process failure, and etc.
This is pretty old, so closing. We are very keen to look into corruption bugs. If this is still an issue and you have a reproduction please reopen - I will look into this ASAP.
Original issue 196 created by jtolds on 2013-07-29T15:46:41.000Z:
Background: recently, pleased with the performance and lack of errors with LevelDB, we decided to turn on paranoid mode. Paranoid mode ended up being all sorts of bad, as it frequently complained of corruptions (failing to open the entire DB) for evidently pretty common events in the case of process death.
We discovered that if you turn on paranoid mode, write tons of data to LevelDB, then kill the process, the log is easily corrupted, and we suspect it's due to mmap flushing on page-aligned boundaries.
Below is one such example.
The absolute offset inside this file where the data turns into zeros is aligned on a 16k boundary. We suspect this is probably the kernel pushing pages out. It is also the last record in the file. Power loss or some other condition while writing a record could easily cause this, and I am able to reproduce by kill -9'ing a process that is constantly putting records.
I feel like paranoid mode should still work? Or is paranoid mode not recommended for production settings?