-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: Fix logic in BaseTransaction for determining set of committed files when there are no new snapshots #9221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
#9183 @bartash already added tests for the ExpireSnapshots case, but based on the tests passing before that implies there weren't any tests for case 2 above (since those would have caught the behavior change in deletion in case snapshots couldn't be looked up). It may be difficult to test for that case (have to force the lookup of a committed snapshot to be null right after the transaction commits) , but I'll look into it. |
02c33c4 to
0c2f0bf
Compare
0c2f0bf to
de56b30
Compare
bartash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvement to my fix
…tion when there are no new snapshots
de56b30 to
a068c99
Compare
…tion when there are no new snapshots (apache#9221)
…ed (#9223) * Core: Expired Snapshot files in a transaction should be deleted. (#9183) When a snapshot is expired as part of a transaction, the manifest list file(s) should be deleted when the transaction commits. A recent change (#6634) ensured that these files are not deleted when they have also been committed as part of a transaction, but this breaks the simple case where no new files are committed. Fix this by not skipping deletion when the list of committed files is empty. * Core: Fix logic for determining set of committed files in BaseTransaction when there are no new snapshots (#9221) --------- Co-authored-by: Amogh Jahagirdar <[email protected]>
…tion when there are no new snapshots (apache#9221)
…tion when there are no new snapshots (apache#9221)
This is a follow up to #9183. Null gets returned from
committedFilesin 2 cases:1.) The snapshot ID list is empty (e.g. ExpireSnapshots in a transaction). This snapshot ID is the set of snapshots produced as a result of the transaction
2.).The set of committed files could not exactly be determined (e.g. missing any snapshot metadata).
In the first case, the logic should perform file deletion in case there were no new snapshots (e.g. ExpireSnapshots) which #9183 pointed out and addressed.
In the second case, we do want to signal to callers that it's a unique situation and file deletions should not be performed.
What this change does is return an empty set in case 1 and null in case 2 to prevent deleting files when we could not determine the full set of committed files.