reverbrain / eblob

Eblob is an append-only low-level IO library, which saves data in blob files. Created as low-level backend for elliptics
GNU Lesser General Public License v3.0
104 stars 29 forks source link

move backend lock from eblob_write_prepare_disk() to calling functions #129

Closed abudnik closed 9 years ago

abudnik commented 9 years ago

Issue: https://github.com/reverbrain/eblob/issues/118

The problem is reproduced when some delay happens between calling eblob_write_prepare_disk() and eblob_commit_ram(), while defragmentation process is running and L2 cache enabled. These conditions causes inserting to L2 hash (cache) ram control with pointer to bctl which was already defragmented. After that, writing of a new key, which has same L2 hash leads to collision resolving by reading full 64 byte key from bctl (which points to the sorted blob with '-1' blob and index descriptors).

abudnik commented 9 years ago

https://github.com/reverbrain/eblob/pull/130