Merge pull request #10975 from lzhfromustc/currentRev

Add critical section to protect s.currentRev
release-3.5
Jingyi Hu 2019-09-06 12:27:53 -07:00 committed by GitHub
commit 88d998be4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -176,6 +176,7 @@ func (s *store) compactBarrier(ctx context.Context, ch chan struct{}) {
}
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()
s.b.ForceCommit()