Skip to content

fix(accessor): reset keyPos/valPos on recsplit collision retry in domain.go - #19752

Merged
AskAlexSharov merged 1 commit into
cherry-pick-19698-to-mainfrom
fix-domain-keypos-collision-retry-main
Mar 10, 2026
Merged

AskAlexSharov merged 1 commit into
cherry-pick-19698-to-mainfrom
fix-domain-keypos-collision-retry-main

Conversation

@sudeepdino008

Copy link
Copy Markdown
Member

Summary

Same bug pattern as PR #19697 (history.go buildVI page counter).

When buildHashMapAccessor encounters a recsplit collision and retries, keyPos and valPos must be reset to 0. Previously they were declared outside the retry loop, causing incorrect offsets in the .kvi index on retry.

Changes

  • db/state/domain.go: Move keyPos and valPos declarations inside the retry loop
  • db/state/domain_test.go: Add TestDomain_KeyPosResetOnCollisionRetry to verify the fix
  • Cherry-pick test infrastructure from release/3.4 (PR UnitTest: for reset page counter on collision in buildVI #19698):
    • ForceCollisionOnce() method in recsplit for testing
    • _testBuildVIHook in history.go
    • TestHistoryBuildVI_PageCounterResetOnCollisionRetry

Related

…ain.go

Same bug pattern as PR #19697 (history.go buildVI page counter).

When buildHashMapAccessor encounters a recsplit collision and retries,
keyPos and valPos must be reset to 0. Previously they were declared
outside the retry loop, causing incorrect offsets in the .kvi index
on retry.

Also cherry-picks test infrastructure from release/3.4 (PR #19698):
- ForceCollisionOnce() method in recsplit for testing
- _testBuildVIHook in history.go
- TestHistoryBuildVI_PageCounterResetOnCollisionRetry

Adds TestDomain_KeyPosResetOnCollisionRetry to verify the fix.
@sudeepdino008
sudeepdino008 changed the base branch from main to cherry-pick-19698-to-main March 9, 2026 15:44
@AskAlexSharov
AskAlexSharov merged commit 1ebf076 into cherry-pick-19698-to-main Mar 10, 2026
36 of 39 checks passed
@AskAlexSharov
AskAlexSharov deleted the fix-domain-keypos-collision-retry-main branch March 10, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants