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

Add table property tracking number of range deletions #4016

Closed
wants to merge 2 commits into from

Conversation

benesch
Copy link
Contributor

@benesch benesch commented Jun 18, 2018

Add a new table property, rocksdb.num.range-deletions, which tracks the
number of range deletions in a block-based table. Range deletions are no
longer counted in rocksdb.num.entries; as discovered in PR #3778, there
are various code paths that implicitly assume that rocksdb.num.entries
counts only true keys, not range deletions.

/cc @ajkr @nvanbenschoten

Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

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

lgtm. we should probably document the changes to table properties in "HISTORY.md".

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

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

Add a new table property, rocksdb.num.range-deletions, which tracks the
number of range deletions in a block-based table. Range deletions are no
longer counted in rocksdb.num.entries; as discovered in PR facebook#3778, there
are various code paths that implicitly assume that rocksdb.num.entries
counts only true keys, not range deletions.
@benesch
Copy link
Contributor Author

benesch commented Jun 20, 2018

Sure thing. Done.

@facebook-github-bot
Copy link
Contributor

@benesch has updated the pull request.

@facebook-github-bot
Copy link
Contributor

@benesch has updated the pull request. View: changes, changes since last import

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ajkr is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ajkr is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@benesch benesch deleted the num-range-dels branch July 10, 2018 21:36
nvanbenschoten pushed a commit to nvanbenschoten/rocksdb that referenced this pull request Jul 11, 2018
Summary:
Add a new table property, rocksdb.num.range-deletions, which tracks the
number of range deletions in a block-based table. Range deletions are no
longer counted in rocksdb.num.entries; as discovered in PR facebook#3778, there
are various code paths that implicitly assume that rocksdb.num.entries
counts only true keys, not range deletions.

/cc ajkr nvanbenschoten
Closes facebook#4016
petermattis pushed a commit to petermattis/rocksdb that referenced this pull request Jul 13, 2018
Summary:
Add a new table property, rocksdb.num.range-deletions, which tracks the
number of range deletions in a block-based table. Range deletions are no
longer counted in rocksdb.num.entries; as discovered in PR facebook#3778, there
are various code paths that implicitly assume that rocksdb.num.entries
counts only true keys, not range deletions.

/cc ajkr nvanbenschoten
Closes facebook#4016

Differential Revision: D8527575

Pulled By: ajkr

fbshipit-source-id: 92e7edbe78fda53756a558013c9fb496e7764fd7
rcane pushed a commit to rcane/rocksdb that referenced this pull request Sep 13, 2018
Summary:
Add a new table property, rocksdb.num.range-deletions, which tracks the
number of range deletions in a block-based table. Range deletions are no
longer counted in rocksdb.num.entries; as discovered in PR facebook#3778, there
are various code paths that implicitly assume that rocksdb.num.entries
counts only true keys, not range deletions.

/cc ajkr nvanbenschoten
Closes facebook#4016

Differential Revision: D8527575

Pulled By: ajkr

fbshipit-source-id: 92e7edbe78fda53756a558013c9fb496e7764fd7
pdillinger added a commit to pdillinger/rocksdb that referenced this pull request Apr 30, 2024
Summary: We've seen an internal crash test+sanitizer failure seemingly
caused by underflow on `current_num_non_deletions_` which would happen
if num_entries < num_deletions. (T186407810)

This change adds an additional check (fail earlier?) and coerces read
table properties to satisfy the invariant that is supposed to be
provided by facebook#4841 but could
be violated by older files, due to
facebook#4016.

Test Plan: existing tests
facebook-github-bot pushed a commit that referenced this pull request May 3, 2024
Summary:
We've seen an internal crash test+sanitizer failure seemingly caused by underflow on `current_num_non_deletions_` which would happen if num_entries < num_deletions. (T186407810)

This change adds an additional check (fail earlier?) and coerces read table properties to satisfy the invariant that is supposed to be provided by #4841 but could be violated by older files, due to
#4016.

Pull Request resolved: #12600

Test Plan: existing tests

Reviewed By: ajkr

Differential Revision: D56796191

Pulled By: pdillinger

fbshipit-source-id: 6d22cc40eb74974c42b311293ee2775c6af95afc
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.

3 participants