[BUG][kernel] Fix txn action conflict detection to always conflict when app_ids match
According to the Delta protocol, two actions with the same should always conflict. However, the kernel's conflict detection logic was incorrectly allowing transactions with the same to not conflict when the 'winning' version was less than the 'losing' version.
This PR fixes the issue by removing the version comparison condition in the method of . Now, any two transactions with the same will always conflict, regardless of their versions.
Fixes #4442
Which Delta project/connector is this regarding?
- [ ] Spark
- [ ] Standalone
- [ ] Flink
- [x] Kernel
- [ ] Other (fill in here)
Description
- Describe what this PR changes. This PR fixes a bug in the conflict detection logic for transactions with the same app_id. The current implementation only throws a conflict exception when the winning transaction's version is >= the losing transaction's version, but according to the protocol, any two transactions with the same app_id should conflict regardless of version.
- Describe why we need the change. This change is needed to correctly implement the Delta protocol specification for transaction conflict detection.
How was this patch tested?
Added comprehensive tests in both standalone connector and Spark module to verify that transactions with the same app ID will conflict regardless of their version numbers:
- Test where the winning transaction has a lower version than the losing transaction (this was the bug we fixed)
- Test where the winning transaction has a higher version than the losing transaction (this was already working correctly)
Does this PR introduce any user-facing changes?
'No'.
Thanks for contributing the fix here @meatulbisht !
minor test comments. Once fixed, this PR is good to merge.
Hi @vkorukanti ,
Have worked on the comments , I think it's successful now. Please take a look, and let me know if any further changes are needed.
Thank you