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

[3.5] Fix the data inconsistency issue by adding a txPostLockHook into the backend #13908

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Apr 8, 2022

Back port pull/13854 to 3.5.

The original issue: 13766

@serathius serathius mentioned this pull request Apr 8, 2022
28 tasks
@ahrtr
Copy link
Member Author

ahrtr commented Apr 8, 2022

cc @ptabor @serathius @spzala

The failure should have nothing to do with this PR. The test can pass in my local environment.

…backend

Previously the SetConsistentIndex() is called during the apply workflow,
but it's outside the db transaction. If a commit happens between SetConsistentIndex
and the following apply workflow, and etcd crashes for whatever reason right
after the commit, then etcd commits an incomplete transaction to db.
Eventually etcd runs into the data inconsistency issue.

In this commit, we move the SetConsistentIndex into a txPostLockHook, so
it will be executed inside the transaction lock.
@ahrtr
Copy link
Member Author

ahrtr commented Apr 8, 2022

Just rebased this PR.

Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ahrtr
lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants