-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
No need to consider ConcurrentAppendException/ConcurrentDeleteReadException when check commit conflict with Compaction's commit Actions #326
Comments
Yes, you are right. The current logic in |
@mukulmurthy and I had caught this corner some time ago and discussed the exact same approach. |
Thanks for your reply! I'd like to make pr for this. |
Yay! Happy to review it whenever you make one. |
@windpiger any updates on this? |
|
I ran into the same issue myself and started looking into Specifically, this is what I changed: For // before
val conflictingFile = DeltaLog.filterFileList(
metadata.partitionSchema,
addedFilesToCheckForConflicts.toDF(), p :: Nil).as[AddFile].take(1)
// after
val conflictingFile = DeltaLog.filterFileList(
metadata.partitionSchema,
addedFilesToCheckForConflicts.filter(_.dataChange).toDF(), p :: Nil).as[AddFile].take(1) For // before
val deleteReadOverlap = removedFiles.find(r => readFilePaths.contains(r.path))
// after
val deleteReadOverlap = removedFiles.find(r => r.dataChange & readFilePaths.contains(r.path)) |
Just an update: I ran extensive tests with the above changes and this solution seems to perform as required. I'll attempt to submit a PR when I have the time, but if anyone else want to test this solution themselves- it's only 2 lines of code :) |
I have a Scenario related to Conflict check, that is when the current txn check conflict with a already committed Compaction's actions(AddFile&RemoveFile), should we need to consider ConcurrentAppendException/ConcurrentDeleteReadException?
I think there is no need to do these two Exceptions conflict check, but we should keep the last ConcurrentDeleteDeleteException in this Scenario.
Because the actions of Compation is dataChange=false, it just rerange the data, not modify it.
the data of the new AddFile in Compaction's actions should already be read by the current txn.
the data of the RemoveFile in Compaction's actions does not be deleted, they just reranger
to other files. So it does not affect the AddFiles read by the current txn, even they deleted by Compaction.
Can any one help to review the logic? @marmbrus @zsxwing Thanks!
If it is correct, we can reduce some conflict.
The text was updated successfully, but these errors were encountered: