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()
|
||||
defer s.txnLk.RUnlock()
|
||||
|
||||
if !s.txnActive {
|
||||
s.txnViews.Add(1)
|
||||
return &s.txnViews
|
||||
s.txnViews.Add(1)
|
||||
if s.txnActive {
|
||||
s.trackTxnRef(c)
|
||||
}
|
||||
|
||||
s.trackTxnRef(c)
|
||||
return nil
|
||||
return &s.txnViews
|
||||
}
|
||||
|
||||
// transactionally protect a reference to an object
|
||||
|
Loading…
Reference in New Issue
Block a user