Repository navigation
Conversation
On a retry, the check for new deletes on the data files being replaced built its delete index with the operation's filter, so it skipped delete files whose column bounds can't match the filter. A partial delete rewrites those files in full, so it could commit over a concurrent delete outside the filter and bring the deleted rows back. Check every delete file added since the starting snapshot against the replaced data files instead. The filter is no longer used there, so drop it from the signature.
This branch has not been deployed
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.
Closes #4291.
Rationale for this change
Follow-up to #4292, which handled the rewrite itself. This covers the retry conflict check from the issue.
When a commit retries,
_validate_no_new_deletes_for_data_fileschecks that no new delete file applies to the data files being replaced. It built its delete index with the operation's filter, though, so_filter_manifest_entriesskipped any delete file whose column bounds can't match that filter. A partial delete rewrites those data files in full, so a concurrent delete outside the filter went unnoticed. The retry then committed the rewritten file, and the rows that delete removed came back.Now every delete file added since the starting snapshot is checked against the replaced data files. The filter is no longer used there, so
data_filterandcase_sensitiveare dropped from the private function's signature._validate_no_new_delete_files, the filter-based check, is unchanged.Are these changes tested?
Yes.
test_partial_delete_validates_concurrent_delete_outside_the_filterintests/table/test_commit_retry.pyruns against each catalog fixture:delete("k = 1");(2, 'b')is committed. It has boundsk = 2, built withcommit_partition_position_delete;ValidationException, leavingk = [1, 3].Without the fix, the test fails with
DID NOT RAISE ValidationException, because the retry commits over the concurrent delete.Are there any user-facing changes?
A partial delete, filtered overwrite or upsert that races with a delete on the same data file now fails validation on retry, instead of silently bringing the deleted rows back.