]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Fix data loss after DB recovery by not allowing flush/compaction to be scheduled...
authorsdong <siying.d@fb.com>
Thu, 16 Jul 2015 02:58:28 +0000 (19:58 -0700)
committersdong <siying.d@fb.com>
Thu, 16 Jul 2015 21:57:50 +0000 (14:57 -0700)
commitd99227db23b3c66d95694de45cd5972b4ae06b13
treeb34ebb370c75981ed8ab3077410bfc8c9d025183
parent28d3aa3667e71f4ded4bb1cf6432fa8e992fcf21
Fix data loss after DB recovery by not allowing flush/compaction to be scheduled until DB opened

Summary:
Previous run may leave some SST files with higher file numbers than manifest indicates.
Compaction or flush may start to run while DB::Open() is still going on. SST file garbage collection may happen interleaving with compaction or flush, and overwrite files generated by compaction of flushes after they are generated. This might cause data loss. This possibility of interleaving is recently introduced.
Fix it by not allowing compaction or flush to be scheduled before DB::Open() finishes.

Test Plan: Add a unit test. This verification will have a chance to fail without the fix but doesn't fix without the fix.

Reviewers: kradhakrishnan, anthony, yhchiang, IslamAbdelRahman, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D42399
db/db_impl.cc
db/fault_injection_test.cc