Fix hash PK rollback after failed COPY#523
Merged
Merged
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 genericdiscardPrimaryKey()rollback hook and wired the hash primary-key index implementation todelete_().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 astransaction~copy~copy_node.CopyNodeAfterPKErrorRollbackFlushedGroupsreturning no row forComment.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 atb2055a915.Change
PrimaryKeyIndex::discardPrimaryKey()now removes matching keys only from local uncommitted hash-index insertions viadiscardLocal(). It no longer callsdelete_()and therefore does not add local deletion entries during COPY rollback.Validation
make test-build-releaseIN_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'