-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail point-in-time WAL recovery upon IOError reading WAL #6963
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I wonder if we should reject Open()
for all errors returned by the underlying Env
. It's difficult right now because we can't distinguish where status->IsCorruption()
originates -- it could either be from the underlying Env
or from RocksDB detecting checksum mismatch. In any case I think this PR is a step forward and should be landed.
In other places such as https://github.com/facebook/rocksdb/blob/master/db/version_set.h#L1162, RocksDB uses a separate status variable to keep track of IO errors. We probably can follow similar approach by adding a member variable to |
97e18e7
to
847f618
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@riversand963 merged this pull request in 717749f. |
Thanks for the improvement! |
If
options.wal_recovery_mode == WALRecoveryMode::kPointInTimeRecovery
, RocksDB stops replaying WAL once hitting an error and discards the rest of the WAL. This can lead to data loss if the error occurs at an offset smaller than the last sync'ed offset.Ideally, RocksDB point-in-time recovery should permit recovery if the error occurs after last synced offset while fail recovery if error occurs before the last synced offset. However, RocksDB does not track the synced offset of WALs. Consequently, RocksDB does not know whether an error occurs before or after the last synced offset. An error can be one of the following.
Test plan (devserver):
make check