diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index e01ce684c..12d0ff899 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -276,7 +276,7 @@ func (s *SplitStore) markLiveRefs(cids []cid.Cid) { } log.Debugw("marking live refs done", "took", time.Since(startMark), "marked", *count, "size marked", *szMarked) - s.szMarkedLiveRefs += *szMarked + s.szMarkedLiveRefs += atomic.LoadInt64(szMarked) } // transactionally protect a view @@ -419,7 +419,7 @@ func (s *SplitStore) protectTxnRefs(markSet MarkSet) error { if err := g.Wait(); err != nil { return err } - s.szProtectedTxns += *sz + s.szProtectedTxns += atomic.LoadInt64(sz) log.Infow("protecting transactional refs done", "took", time.Since(startProtect), "protected", count, "protected size", sz) } } @@ -1078,7 +1078,7 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp } log.Infow("chain walk done", "walked", *walkCnt, "scanned", *scanCnt, "walk size", szWalk) - s.szWalk = *szWalk + s.szWalk = atomic.LoadInt64(szWalk) return nil } diff --git a/blockstore/splitstore/splitstore_gc.go b/blockstore/splitstore/splitstore_gc.go index 43832a585..1a5fbda68 100644 --- a/blockstore/splitstore/splitstore_gc.go +++ b/blockstore/splitstore/splitstore_gc.go @@ -13,7 +13,7 @@ const ( // Don't attempt moving GC with 50 GB or less would remain during moving GC targetBuffer = 50_000_000_000 // Fraction of garbage in badger vlog for online GC traversal to collect garbage - aggressiveOnlineGCThreshold = 0.0001 + AggressiveOnlineGCThreshold = 0.0001 ) func (s *SplitStore) gcHotAfterCompaction() { @@ -59,7 +59,7 @@ func (s *SplitStore) gcHotAfterCompaction() { log.Warn("If problem continues you can 1) temporarily allocate more disk space to hotstore and 2) reflect in HotstoreMaxSpaceTarget OR trigger manual move with `lotus chain prune hot-moving`") log.Warn("If problem continues and you do not have any more disk space you can run continue to manually trigger online GC at aggressive thresholds (< 0.01) with `lotus chain prune hot`") - opts = append(opts, bstore.WithThreshold(aggressiveOnlineGCThreshold)) + opts = append(opts, bstore.WithThreshold(AggressiveOnlineGCThreshold)) } if err := s.gcBlockstore(s.hot, opts); err != nil {