server: Attempt to fix data corruption #13840
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on git bisect I identified 5005167 as root cause (still not 100% confirmed). In this commit the only change I think could introduce the corruption content of
OnPreCommitUnsafe
. Call to this method was introduced in https://github.com/etcd- io/etcd/pull/12855/commits/9f11b16b2dcab5922bed18b818b84fc1113f7e06 where it is called bycommit
method.Overall I found it weird in #12855 that introduces both changes, fact that this refactor adds calls
indexer.UnsafeWrite
outside read lock, which doesn't match previous behavior. This is still guessing, and I haven't verified the fix, so I leave it up to author/reviewers of the original PR. cc @ptab