From 52de95d3443841d0b51594544cf744317042c139 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 8 Mar 2021 18:30:09 +0200 Subject: [PATCH] also gc in compactFull, not just compactSimple --- blockstore/splitstore/splitstore.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index c69e26cc2..6551b6d51 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -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)