-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: db transaction inconsistencies when deleting keys #1139
Conversation
Test Results 50 files 50 suites 1m 39s ⏱️ Results for commit bf9e1eb. |
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.
LGTM 💯
return transactionCache.containsKey(keyBytes) || database.containsKey(keyBytes); | ||
return !deletedKeys.contains(keyBytes) | ||
&& (transactionCache.containsKey(keyBytes) || database.containsKey(keyBytes)); |
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.
👍 Nice find! Makes sense
if (deletedKeys.contains(key)) { | ||
return null; | ||
} |
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.
👍 Makes sense too! Nice find!
@megglos There is already a |
bors merge |
1139: fix: db transaction inconsistencies when deleting keys r=megglos a=megglos ## Description The main cause of #1001 was the bug fixed via 77e162c . Within the same transaction you couldn't insert a previously deleted key, this happened as after processing the first processes complete command a new message start event correlation was triggered, failing as the previous active process instance was still in the database as the transaction wasn't commited and deleted keys of the transaction weren't checked. I also noticed there was a bug in the `get` by key method, not checking the deletedKeys set either and fixed that too with bf9e1eb . I verified the fix as well with the test case provided in the original issue, I decided against adding it though as the unit test covers the behavior of the db transaction that was the cause of the message start event test case failing. ## Related issues <!-- Which issues are closed by this PR or are related --> closes #1001 Co-authored-by: Meggle (Sebastian Bathke) <sebastian.bathke@camunda.com>
Build failed: |
bors retry flake |
Build succeeded: |
Successfully created backport PR for |
Successfully created backport PR for |
Successfully created backport PR for |
Successfully created backport PR for |
Successfully created backport PR for |
Description
The main cause of #1001 was the bug fixed via 77e162c . Within the same transaction you couldn't insert a previously deleted key, this happened as after processing the first processes complete command a new message start event correlation was triggered, failing as the previous active process instance was still in the database as the transaction wasn't commited and deleted keys of the transaction weren't checked.
I also noticed there was a bug in the
get
by key method, not checking the deletedKeys set either and fixed that too with bf9e1eb .I verified the fix as well with the test case provided in the original issue, I decided against adding it though as the unit test covers the behavior of the db transaction that was the cause of the message start event test case failing.
Related issues
closes #1001