]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Disallow transaction log iterator to skip sequences
authorMayank Agarwal <amayank@fb.com>
Mon, 21 Oct 2013 02:06:19 +0000 (19:06 -0700)
committerMayank Agarwal <amayank@fb.com>
Tue, 22 Oct 2013 18:45:35 +0000 (11:45 -0700)
commitae8e0770b47cfc11b6d8ea901b2d5aa8347249cb
treec165afcf00f4795ff69a901b129b963df1c27190
parentc674b42d522408d870b1c3325886b5de9fb84aa7
Disallow transaction log iterator to skip sequences

Summary:
This is expected to solve the "gaps in transaction log iterator" problem.
* After a lot of observations on the gaps on the sigmafio machines I found that it is due to a race between log reader and writer always.
* So when we drop the wormhole subscription and refresh the iterator, the gaps are not there.
* It is NOT due to some boundary or corner case left unattended in the iterator logic because I checked many instances of the gaps against their log files with ldb. The log files are NOT corrupted also.
* The solution is to not allow the iterator to read incompletely written sequences and detect gaps inside itself and invalidate it which will cause the application to refresh the iterator normally and seek to the required sequence properly.
* Thus, the iterator can at least guarantee that it will not give any gaps.

Test Plan:
* db_test based log iterator tests
* db_repl_stress
* testing on sigmafio setup to see gaps go away

Reviewers: dhruba, haobo

Reviewed By: dhruba

CC: leveldb
Differential Revision: https://reviews.facebook.net/D13593
db/transaction_log_impl.cc
db/transaction_log_impl.h