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

More checks around num_entries vs. num_deletions #12600

Closed

Conversation

pdillinger
Copy link
Contributor

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.

Test Plan: existing tests

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
Copy link
Contributor

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

// Ensure new invariants on old files
file_meta->num_deletions =
std::max(tp->num_deletions, tp->num_range_deletions);
file_meta->num_entries = std::max(tp->num_entries, tp->num_deletions);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think tp->num_entries >= tp->num_deletions even for old files. Did you mean std::max(tp->num_entries, tp->num_range_deletions);?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just being slightly more proactive against unexpected serialized data breaking an invariant.

@facebook-github-bot
Copy link
Contributor

@pdillinger merged this pull request in a178d15.

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