Skip to content
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

Write failure can be permanently fatal and break WriteBatch atomicity #13428

Closed
wants to merge 1 commit into from

Conversation

pdillinger
Copy link
Contributor

Summary: This adds a test that attempts DeleteRange() with PlainTable (not supported) and shows that it not only puts the DB in failed write mode, it (a) breaks WriteBatch atomicity for readers, because they can see just part of a failed WriteBatch, and (b) makes the DB not recoverable (without manual intervention) if using WAL.

Note: WriteBatch atomicity is not clearly documented but indicated at the top of write_batch.h and the wiki page for Transactions, even without Transactions.

Test Plan: this is the test

Summary: This adds a test that attempts DeleteRange() with PlainTable
(not supported) and shows that it not only puts the DB in failed write
mode, it (a) breaks WriteBatch atomicity for readers, because they can
see just part of a failed WriteBatch, and (b) makes the DB not
recoverable (without manual intervention) if using WAL.

Note: WriteBatch atomicity is not clearly documented but indicated at
the top of write_batch.h and the wiki page for Transactions, even
without Transactions.

Test Plan: this is the test
@facebook-github-bot
Copy link
Contributor

@pdillinger has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@anand1976 anand1976 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@facebook-github-bot
Copy link
Contributor

@pdillinger merged this pull request in ebaeb03.

@jowlyzhang
Copy link
Contributor

@pdillinger There is some WriteBatch atomicity documentation here: https://github.com/facebook/rocksdb/wiki/Basic-Operations#atomic-updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants