-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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.4] clientv3/mvcc: fixed DATA RACE #14279
Conversation
…csReporter and mvcc.(*store).restore Signed-off-by: SimFG <1142838399@qq.com>
cc @ahrtr |
@@ -35,7 +35,7 @@ require ( | |||
github.com/soheilhy/cmux v0.1.4 | |||
github.com/spf13/cobra v0.0.3 | |||
github.com/spf13/pflag v1.0.1 | |||
github.com/stretchr/testify v1.3.0 // indirect |
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.
Did you manually make this change?
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.
No, it's GoLand editor.
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
Thank you @SimFG
Codecov Report
@@ Coverage Diff @@
## release-3.4 #14279 +/- ##
==============================================
Coverage ? 75.50%
==============================================
Files ? 456
Lines ? 37037
Branches ? 0
==============================================
Hits ? 27965
Misses ? 7331
Partials ? 1741
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. |
clientv3/mvcc: fixed DATA RACE between mvcc.(*store).setupMetricsReporter and mvcc.(*store).restore
issue: #14270
By comparing the code on the main branch, it is found that the main branch does not have this problem. But there is a small problem on the main branch, the code is as follows:
etcd/server/storage/mvcc/kvstore.go
Lines 349 to 364 in a3b410c
L362:
s.compactMainRev
I think this needs a read lock. However, I think this simple modification like this pull request is more appropriate.
Signed-off-by: SimFG 1142838399@qq.com