Skip to content
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

Begin the migration of executions table operation using atomic counter #1420

Merged
merged 6 commits into from Apr 5, 2021

Conversation

wxing1292
Copy link
Contributor

What changed?

  • Add db version attribute to executions table for better CAS guarantee
  • 1.9.x will by default use existing next event ID for CAS, but will also support the new DB version CAS
  • 1.10.x will by default use DB version CAS

Why?
Last event ID is not enough for CAS operation protection: e.g. activity heartbeat will not generate new history event, meaning last event ID will remain the same during the CAS to DB.
The newly introduced DB version will be increased by 1 each time execution table is updated (update to mutable state record).

Close #435

How did you test it?
Existing tests, randomized tests, CICD

Potential risks
Some low level persistence interfaces are changed.

Is hotfix candidate?
No

@wxing1292 wxing1292 requested a review from a team March 30, 2021 22:32
* Add db version attribute to executions table for better CAS guarantee
* 1.9.x will by default use existing next event ID for CAS, but will also support the new DB version CAS
* 1.10.x will by default use DB version CAS
@wxing1292 wxing1292 enabled auto-merge (squash) April 5, 2021 21:57
@wxing1292 wxing1292 merged commit 5767244 into temporalio:master Apr 5, 2021
@wxing1292 wxing1292 deleted the versioning branch April 5, 2021 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lastEventId is not enough to protect mutable state updates
2 participants