mvcc: force commit and hash should be atomic for getting hash

This commit is contained in:
Xiang Li
2016-08-27 19:22:22 -07:00
parent c388b2f22f
commit 1437388f77

View File

@@ -323,10 +323,9 @@ func (s *store) Compact(rev int64) (<-chan struct{}, error) {
}
func (s *store) Hash() (uint32, int64, error) {
s.b.ForceCommit()
s.mu.Lock()
defer s.mu.Unlock()
s.b.ForceCommit()
// ignore hash consistent index field for now.
// consistent index might be changed due to v2 internal sync, which