-
Notifications
You must be signed in to change notification settings - Fork 49
SWATCH-3545: Conflict resolution periodically creates incorrect amendment event #4800
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
base: main
Are you sure you want to change the base?
Conversation
⛏️ Workflow Run 🧪 JUnit
Details
|
f46af34
to
8e15c5a
Compare
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've been taking a look into the issue, and don't see how the REQUIRED_NEW is related to the issue.
The intention of always creating a new transaction is to ensure that all the events from the batch are correctly persisted (without SQL errors / constraint violations that are only validated after transaction ends).
I created a EventControllerIT class to validate the need of creating a new transaction, and also to reproduce the resolution issue that is related to SWATCH-3545 instead of using scripts ... You can see this file in 5ec234c.
If you run this new test in my branch or main, you will see that:
- testIntraBatchConflictResolutionTransactionFix does not work because I didn't update the EventConflictResolver logic.
- testTransactionIsolationForFailedEvents works.
Then, if you run this test in your branch, you will see that:
- testTransactionIsolationForFailedEvents does not work.
About testIntraBatchConflictResolutionTransactionFix, this test should be working with your changes, but your changes are causing other tests to fail which I think your fix invalidates how is designed maybe?
a189439
to
e659f96
Compare
e659f96
to
e70c782
Compare
This test demonstrates the intra-batch conflict resolution bug where events with the same conflict key within a single batch create inappropriate deduction events instead of being properly deduplicated. The test expects only 1 final event (3.0 cores) but currently fails because the implementation creates excessive amendment events for intra-batch conflicts. Co-Authored-By: Jose Carvajal <[email protected]>
e70c782
to
ed26f75
Compare
IQE Tests Summary Report1 failed, 306 passed, 3 skipped, 165 deselected, 386 warnings in 2014.80s (0:33:34)
|
Updated PR Description for SWATCH-3545
Jira issue: SWATCH-3545, SWATCH-3809
Updated PR Description
Title: SWATCH-3545: Fix event conflict resolution to prevent duplicate amendment cascades
Description:
Problem
Event conflict resolution was creating excessive amendment events when processing batches containing multiple events with the same conflict key. This resulted in cascading deduction/addition cycles that polluted the event stream
and caused incorrect tallying.
Root Cause: The original conflict resolution treated each event in a batch independently, creating amendment events for intra-batch conflicts that should have been deduplicated instead.
Solution
This PR implements a two-phase conflict resolution strategy:
Key Changes
Core Implementation (EventConflictResolver.java)
Comprehensive Test Coverage
Results
Behavior Changes
This change significantly improves event processing efficiency while maintaining the correctness of the conflict resolution system.