Skip to content

db/state: unify commitment-branch referencing predicate#20963

Merged
AskAlexSharov merged 2 commits into
performancefrom
alex/pick1_35_p
May 4, 2026
Merged

db/state: unify commitment-branch referencing predicate#20963
AskAlexSharov merged 2 commits into
performancefrom
alex/pick1_35_p

Conversation

@AskAlexSharov

Copy link
Copy Markdown
Collaborator

Cherry-pick of #20944 to performance branch.

ValuesPlainKeyReferencingThresholdReached was a parity check
((span)%2 == 0) and MayContainValuesPlainKeyReferencing was a strict-
greater size check (span > 2). Under the old merge planner spans were
always {1, 2, 4, 8, ...}, so the parity test was effectively "merged
file?" — but with clipMergeStartToFileBoundary the planner can now emit
odd spans >= 3, which the parity test misclassifies as plain and the
read path then fails to dereference. The two predicates also disagreed
at span = 2: the write path shortened those files but the integrity
check skipped them.

Replace both bodies with span >= minStepsForReferencing (= 2), matching
the constant's name, and drop MayContainValuesPlainKeyReferencing in
favor of the surviving function. Span-1 files (the only legitimate
plain case) are unchanged; every multi-step file is now consistently
treated as referencing on read, write, and integrity paths.
@AskAlexSharov AskAlexSharov changed the base branch from main to performance May 4, 2026 04:01
@AskAlexSharov AskAlexSharov enabled auto-merge (squash) May 4, 2026 04:02
@AskAlexSharov AskAlexSharov changed the title db/state, db/integrity: unify commitment-branch referencing predicate db/state: unify commitment-branch referencing predicate May 4, 2026
@AskAlexSharov AskAlexSharov merged commit 5822185 into performance May 4, 2026
34 of 35 checks passed
@AskAlexSharov AskAlexSharov deleted the alex/pick1_35_p branch May 4, 2026 09:28
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.

3 participants