-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: Fix deleted data files validation in OverwriteFiles #4303
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
1bda55e to
ff4e42d
Compare
|
@rdblue @szehon-ho @RussellSpitzer, could you take a look? |
| private Expression conflictDetectionFilter = null; | ||
| private boolean validateNewDataFiles = false; | ||
| private boolean validateNewDeleteFiles = false; | ||
| private boolean validateNewDeletes = false; |
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.
Why the rename here?
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.
Cause we not only validate added delete files but also deleted data files. We have two types of deletes to cover.
| if (rowFilter() != Expressions.alwaysFalse()) { | ||
| Expression filter = conflictDetectionFilter != null ? conflictDetectionFilter : rowFilter(); | ||
| validateNoNewDeleteFiles(base, startingSnapshotId, filter); | ||
| validateDeletedDataFiles(base, startingSnapshotId, filter); |
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.
👍
| } | ||
|
|
||
| @Test | ||
| public void testConcurrentConflictingDataFileDeleteOverwriteByFilter() { |
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.
This test would previously fail as the commit would succeed.
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.
The error here is because file 2 is both modified and deleted correct?
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.
Yeah, we concurrently removed data from a partition what we are trying to overwrite.
|
|
||
| Snapshot firstSnapshot = table.currentSnapshot(); | ||
|
|
||
| OverwriteFiles overwrite = table.newOverwrite() |
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.
While this one is alright because file 2 is modified, but file 1 is deleted.
RussellSpitzer
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.
Looks good to me
|
+1 from me too, glad we found and fixed it! |
|
Thanks, @RussellSpitzer @szehon-ho! Merged to unblock Szehon's PR. |
(cherry picked from commit cceef9f)
This PR fixes the deleted data files validation for overwrites by filter in
OverwriteFiles. Right now, we allow removal of data files in partitions we overwrite, which, I think violates the assumption.Found by @szehon-ho in #4293.