-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db: do not recycle WAL files used for recovery
WAL recycling depends on the recycled WAL only containing log records written with the recyclable record format. Pebble always writes WAL files with the recyclable record format, but RocksDB only uses that format if WAL recycling is enabled. If Pebble recycles a RocksDB-written WAL that doesn't use the recyclable record format, it can leave valid looking log entries in the tail of the log. A subsequent replay of the WAL by either Pebble or RocksDB could then replay those already committed log entries. The most common way this badness would be detected is by Pebble's L0 consistency checks, though the varieties of badness here are almost unlimited (deleted records reappearing, written records being deleted, etc). In order to protect against this, Pebble now only recycles WAL files that it has written in the current incarnation and thus knows for certain have been written with the recyclable record format. RocksDB has similar behavior, though the code which achieves this is somewhat convoluted so the behavior may have been accidental. Fixes #567
- Loading branch information
1 parent
f0b10da
commit f3bd334
Showing
4 changed files
with
60 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters