Skip to content

Fix locking in store rollback#2103

Merged
achamayou merged 2 commits into
microsoft:masterfrom
achamayou:fix_store_rollback
Jan 22, 2021
Merged

Fix locking in store rollback#2103
achamayou merged 2 commits into
microsoft:masterfrom
achamayou:fix_store_rollback

Conversation

@achamayou

Copy link
Copy Markdown
Member

Store::rollback() acquires and holds the maps lock for its entire execution, and the version lock several times (twice explicitly, one or two more times indirectly via current_version()). The term is updated under the first acquisition, but the version (and other elements of state) are only updated in the final acquisition.

As a result, a transaction starting in the middle of a rollback() could when it captures current_txid() grab an incorrect (term, version) pair. Making all store state changes atomically under a single acquisition of the version lock fixes that.

@achamayou achamayou requested a review from a team as a code owner January 22, 2021 11:20
@achamayou achamayou mentioned this pull request Jan 22, 2021
@ghost

ghost commented Jan 22, 2021

Copy link
Copy Markdown

fix_store_rollback@17866 aka 20210122.15 vs master ewma over 50 builds from 17216 to 17861
images

@achamayou achamayou merged commit 55ceb77 into microsoft:master Jan 22, 2021
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.

2 participants