-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixing bug introducted in rollback for MOR table type with inserts into log files #417
Fixing bug introducted in rollback for MOR table type with inserts into log files #417
Conversation
@vinothchandar @bvaradar please review. |
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.
Otherwise, the fix looks good.
super.deleteCleanedFiles(filesToDeletedStatus, partitionPath, filter); | ||
final Set<String> deletedFiles = filesToDeletedStatus.entrySet().stream() | ||
.map(entry -> { | ||
Path filePath = entry.getKey().getPath(); |
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.
Minor : Looks like a reusable functionality of finding the fileId from a file-path (either log-file or parquet). Can you introduce a FSUtils method and move the logic there ?
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.
done
@@ -428,14 +429,16 @@ public void testRollbackWithDeltaAndCompactionCommit() throws Exception { | |||
dataFilesToRead.findAny().isPresent()); | |||
|
|||
/** | |||
* Write 2 (updates) | |||
* Write 2 (inserts + updates) |
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.
I tried applying the test-code patch alone to understand. I expected the test case to fail since I did not apply the actual fix but the test passed. Can you cross-check to see if some assertion needs to be added.
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.
okay, let me check.
b29a807
to
51da8d4
Compare
@bvaradar Addressed your concerns, please let @vinothchandar know if it's ready to merge. |
51da8d4
to
ffb7077
Compare
Co-authored-by: StreamingFlames <18889897088@163.com>
The bug was introduced here : 3da063f#diff-4c9f153416cce4b19fd73b4f1dcbb1d1R219
Essentially, the following situation takes place for MOR without inserts into log files :
In case this was a failed commit :
In case of a successful commit being rolled back :
The issue was there was no test case for the case when there are inserts + updates. The filter logic filtering out file ids from the workload for only updates was broken. The filter is now corrected.