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

[2.1 backport] table: Always check key ordering when inserting to an SST #48

Merged

Conversation

itsbilal
Copy link

@itsbilal itsbilal commented Sep 11, 2019

Backport of #46 .

To prevent an out-of-order SSTable insertion from ever happening, this
change updates BlockBasedTableBuilder::Add to always assert on key
ordering being maintained at the insertion point, rather than only
running with debug builds. When an out-of-order key insertion is
detected, the status is set to Corrupted to prevent the BlockBasedTable
from being written.


This change is Reviewable

To prevent an out-of-order SSTable insertion from ever happening, this
change updates BlockBasedTableBuilder::Add to always assert on key
ordering being maintained at the insertion point, rather than only
running with debug builds. When an out-of-order key insertion is
detected, the status is set to Corrupted to prevent the BlockBasedTable
from being written.
@itsbilal itsbilal self-assigned this Sep 11, 2019
Copy link

@petermattis petermattis left a comment

Choose a reason for hiding this comment

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

LGTM

PS Have you been running the RocksDB tests via make check? Hard to imagine them failing on a change like this, but would be good to know.

@itsbilal
Copy link
Author

@petermattis I've been relying on travis to do that - make check seems to always error out on my laptop with an abort trap, even on a clean repo. Looking into why.

@itsbilal
Copy link
Author

Thanks for the review! Gonna put out the cockroach PRs on the release/ branches next.

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

Successfully merging this pull request may close these issues.

2 participants