From 8b0087524fbd07e85dd0895b29f161da91b655e2 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 1 Dec 2020 21:48:08 +0200 Subject: [PATCH] adjust walk boundaries for marking --- chain/store/splitstore/splitstore.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chain/store/splitstore/splitstore.go b/chain/store/splitstore/splitstore.go index 65619b44a..fac3c796c 100644 --- a/chain/store/splitstore/splitstore.go +++ b/chain/store/splitstore/splitstore.go @@ -339,7 +339,7 @@ func (s *SplitStore) compact() { epoch := curTs.Height() coldEpoch := s.baseEpoch + build.Finality - err = s.cs.WalkSnapshot(context.Background(), curTs, epoch-coldEpoch+1, false, false, + err = s.cs.WalkSnapshot(context.Background(), curTs, epoch-coldEpoch, false, false, func(cid cid.Cid) error { return hotSet.Mark(cid) }) @@ -350,7 +350,7 @@ func (s *SplitStore) compact() { } // Phase 1b: mark all reachable CIDs in the cold range - coldTs, err := s.cs.GetTipsetByHeight(context.Background(), coldEpoch-1, curTs, true) + coldTs, err := s.cs.GetTipsetByHeight(context.Background(), coldEpoch, curTs, true) if err != nil { // TODO do something better here panic(err) @@ -392,7 +392,7 @@ func (s *SplitStore) compact() { } // is the object stil hot? - if wrEpoch >= coldEpoch { + if wrEpoch > coldEpoch { // yes, stay in the hotstore stHot++ continue