remove early occurs check from trackTxnRef
this happens inline, and it might block when using the badger markset
This commit is contained in:
parent
2891a31c99
commit
f75d982c76
@ -184,16 +184,6 @@ func (s *SplitStore) trackTxnRef(c cid.Cid) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.txnProtect != nil {
|
|
||||||
mark, err := s.txnProtect.Has(c)
|
|
||||||
if err != nil {
|
|
||||||
log.Warnf("error checking markset: %s", err)
|
|
||||||
// track it anyways
|
|
||||||
} else if mark {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
s.txnRefsMx.Lock()
|
s.txnRefsMx.Lock()
|
||||||
s.txnRefs[c] = struct{}{}
|
s.txnRefs[c] = struct{}{}
|
||||||
s.txnRefsMx.Unlock()
|
s.txnRefsMx.Unlock()
|
||||||
@ -209,27 +199,11 @@ func (s *SplitStore) trackTxnRefMany(cids []cid.Cid) {
|
|||||||
s.txnRefsMx.Lock()
|
s.txnRefsMx.Lock()
|
||||||
defer s.txnRefsMx.Unlock()
|
defer s.txnRefsMx.Unlock()
|
||||||
|
|
||||||
quiet := false
|
|
||||||
for _, c := range cids {
|
for _, c := range cids {
|
||||||
if isUnitaryObject(c) {
|
if isUnitaryObject(c) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.txnProtect != nil {
|
|
||||||
mark, err := s.txnProtect.Has(c)
|
|
||||||
if err != nil {
|
|
||||||
if !quiet {
|
|
||||||
quiet = true
|
|
||||||
log.Warnf("error checking markset: %s", err)
|
|
||||||
}
|
|
||||||
// track it anyways
|
|
||||||
}
|
|
||||||
|
|
||||||
if mark {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
s.txnRefs[c] = struct{}{}
|
s.txnRefs[c] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user