always return the waitgroup in protectView
so that we preclude the following scenario: Start compaction. Start view. Finish compaction. Start compaction. which would not wait for the view to complete.
This commit is contained in:
parent
df9670c58d
commit
759594d01c
@ -629,13 +629,12 @@ func (s *SplitStore) protectView(c cid.Cid) *sync.WaitGroup {
|
|||||||
s.txnLk.RLock()
|
s.txnLk.RLock()
|
||||||
defer s.txnLk.RUnlock()
|
defer s.txnLk.RUnlock()
|
||||||
|
|
||||||
if !s.txnActive {
|
|
||||||
s.txnViews.Add(1)
|
s.txnViews.Add(1)
|
||||||
return &s.txnViews
|
if s.txnActive {
|
||||||
|
s.trackTxnRef(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.trackTxnRef(c)
|
return &s.txnViews
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// transactionally protect a reference to an object
|
// transactionally protect a reference to an object
|
||||||
|
Loading…
Reference in New Issue
Block a user