Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitstore Review #6718

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions blockstore/splitstore/splitstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,8 @@ func (s *SplitStore) trackTxnRefMany(cids []cid.Cid) {
quiet = true
log.Warnf("error checking markset: %s", err)
}
// This is inconsistent with trackTxnRef (where we track it
// anyways).
continue
}

Expand All @@ -703,8 +705,6 @@ func (s *SplitStore) trackTxnRefMany(cids []cid.Cid) {

s.txnRefs[c] = struct{}{}
}

return
}

// protect all pending transactional references
Expand Down Expand Up @@ -936,6 +936,12 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
func (s *SplitStore) compact(curTs *types.TipSet, wg *sync.WaitGroup) {
log.Info("waiting for active views to complete")
start := time.Now()
// I'm not holding the txnLk here. Is it not possible for:
//
// 1. The waitgroup to temporarily hit 0.
// 2. protectView to be called, raising it back to 1.
//
// _Reusing_ a waitgroup is legal. Hitting 0 then going back to 1 while "waiting" is not.
Stebalien marked this conversation as resolved.
Show resolved Hide resolved
wg.Wait()
log.Infow("waiting for active views done", "took", time.Since(start))

Expand Down Expand Up @@ -1457,6 +1463,7 @@ func (s *SplitStore) sortObjects(cids []cid.Cid) error {
wi := weights[key(cids[i])]
wj := weights[key(cids[j])]
if wi == wj {
// nit: consider just comparing the keys?
return bytes.Compare(cids[i].Hash(), cids[j].Hash()) > 0
}

Expand Down