Skip to content

Fix hash PK rollback after failed COPY#523

Merged
adsharma merged 1 commit into
mainfrom
fix/hash-index-copy-rollback
May 26, 2026
Merged

Fix hash PK rollback after failed COPY#523
adsharma merged 1 commit into
mainfrom
fix/hash-index-copy-rollback

Conversation

@adsharma
Copy link
Copy Markdown
Contributor

Summary

Fix failed COPY rollback for hash primary-key indexes by making discardPrimaryKey() discard only uncommitted local insertions instead of recording a local deletion.

Root Cause

The regression was introduced by b2055a915 (Add ART primary key index). That commit added a generic discardPrimaryKey() rollback hook and wired the hash primary-key index implementation to delete_().

For hash indexes, delete_() can create local deletion markers. During the failed duplicate-PK COPY rollback, those markers could mask rows from the subsequent successful COPY. This showed up in the WASM in-memory kernel test as transaction~copy~copy_node.CopyNodeAfterPKErrorRollbackFlushedGroups returning no row for Comment.ID = 962073046352.

The first scheduled main failure after the May 16 successful run was May 17 at 7d6335a7b, with the same failing test; the relevant regression range starts at b2055a915.

Change

PrimaryKeyIndex::discardPrimaryKey() now removes matching keys only from local uncommitted hash-index insertions via discardLocal(). It no longer calls delete_() and therefore does not add local deletion entries during COPY rollback.

Validation

  • make test-build-release
  • IN_MEM_MODE=true E2E_TEST_FILES_DIRECTORY=test/test_files build/release/test/runner/e2e_test --gtest_filter='transaction~copy~copy_node.CopyNodeAfterPKErrorRollbackFlushedGroups'
  • E2E_TEST_FILES_DIRECTORY=test/test_files build/release/test/runner/e2e_test --gtest_filter='transaction~copy~copy_node.CopyNodeAfterPKErrorRollbackFlushedGroups'

@adsharma
Copy link
Copy Markdown
Contributor Author

@adsharma adsharma marked this pull request as ready for review May 26, 2026 20:32
@adsharma adsharma merged commit e98835d into main May 26, 2026
17 checks passed
@adsharma adsharma deleted the fix/hash-index-copy-rollback branch May 26, 2026 23:12
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.

1 participant