]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
db/log_reader: treat bad record length or checksum as EOF
authorSage Weil <sage@redhat.com>
Fri, 11 Dec 2015 22:17:43 +0000 (17:17 -0500)
committerSage Weil <sage@redhat.com>
Fri, 11 Dec 2015 22:26:31 +0000 (17:26 -0500)
commit8a23156804ef86749ba767d672d8a05462d9891b
treee7296d9649bc3192c2427ee3b9eb3b2fd7a29056
parented9f55ae41e1981afdd5c294c70c7e9dfc965752
db/log_reader: treat bad record length or checksum as EOF

If we are in kTolerateCorruptedTailRecords, treat these
errors as the end of the log.  This is particularly
important for recycled logs, where we will regularly see
corrupted headers (bad length or checksum) when replaying
a log.  If we are aligned with a block boundary or get lucky,
we will land on an old header and see the log number
mismatch, but more commonly we will land midway through
some previous block and record and effectively see noise.
These must be treated as the end of the log in order for
recycling to work.

This makes the LogTest.Recycle/1 test pass.

We also modify a number of existing tests because the
recycled log files behave fundamentally differently in that
they always stop when they reach the first bad record.

Signed-off-by: Sage Weil <sage@redhat.com>
db/log_reader.cc
db/log_reader.h
db/log_test.cc