mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #10975 from lzhfromustc/currentRev
Add critical section to protect s.currentRev
This commit is contained in:
commit
88d998be4c
@ -176,6 +176,7 @@ func (s *store) compactBarrier(ctx context.Context, ch chan struct{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *store) Hash() (hash uint32, revision int64, err error) {
|
func (s *store) Hash() (hash uint32, revision int64, err error) {
|
||||||
|
// TODO: hash and revision could be inconsistent, one possible fix is to add s.revMu.RLock() at the beginning of function, which is costly
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
s.b.ForceCommit()
|
s.b.ForceCommit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user