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

[crl-release-23.2] db: remove compaction iter seqnum optimization, replace with assert #3090

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

itsbilal
Copy link
Member

Previously the compaction iterator would avoid user key comparisons in some circumstances when invariants around sequence numbers implied user keys must be different. This commit removes this optimization, replacing it with an assertion that the sequence number invariants hold.

This is done out of caution and with the realization that these user key comparisons form a relatively small portion of the CPU cost of a compaction.

Informs #3082.
Informs cockroachdb/cockroach#114421.

Previously the compaction iterator would avoid user key comparisons in some
circumstances when invariants around sequence numbers implied user keys must be
different. This commit removes this optimization, replacing it with an
assertion that the sequence number invariants hold.

This is done out of caution and with the realization that these user key
comparisons form a relatively small portion of the CPU cost of a compaction.

Informs cockroachdb#3082.
Informs cockroachdb/cockroach#114421.
@itsbilal itsbilal requested review from jbowens and a team November 20, 2023 19:22
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

:lgtm:

Thanks 🙏

@nicktrav
Copy link
Contributor

EM LGTM ✅

@itsbilal
Copy link
Member Author

TFTRs!

I'll run the 23.2 backport workflow on the crdb bump PR.

@itsbilal itsbilal merged commit 2e4fce6 into cockroachdb:crl-release-23.2 Nov 20, 2023
10 checks passed
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.

None yet

4 participants