Skip to content

Commit

Permalink
also gc in compactFull, not just compactSimple
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Mar 8, 2021
1 parent 8562a9b commit 52de95d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blockstore/splitstore/splitstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,17 @@ func (s *SplitStore) compactFull(curTs *types.TipSet) error {
return xerrors.Errorf("error syncing tracker: %w", err)
}

if gc, ok := s.hot.(interface{ GC() error }); ok {
log.Infof("garbage collecting hotstore")
startGC := time.Now()
err = gc.GC()
if err != nil {
log.Warnf("error garbage collecting hotstore: %s", err)
} else {
log.Infow("garbage collecting done", "took", time.Since(startGC))
}
}

err = s.setBaseEpoch(coldEpoch)
if err != nil {
return xerrors.Errorf("error saving base epoch: %w", err)
Expand Down

0 comments on commit 52de95d

Please sign in to comment.