diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index 18aa755bd2..a3b93599f0 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -102,10 +102,6 @@ type Config struct { // from the hotstore should be written to the cold store UniversalColdBlocks bool - // FullWarmup indicates to do a chain traversal upon splitstore init to copy - // from cold store to hot store - FullWarmup bool - // HotstoreMessageRetention indicates the hotstore retention policy for messages. // It has the following semantics: // - a value of 0 will only retain messages within the compaction boundary (4 finalities) diff --git a/blockstore/splitstore/splitstore_test.go b/blockstore/splitstore/splitstore_test.go index 23eadec1fb..ad6639f77f 100644 --- a/blockstore/splitstore/splitstore_test.go +++ b/blockstore/splitstore/splitstore_test.go @@ -163,11 +163,11 @@ func testSplitStore(t *testing.T, cfg *Config) { hotCnt := countBlocks(hot) if coldCnt != 2 { - t.Errorf("expected %d blocks, but got %d", 2, coldCnt) + t.Fatalf("expected %d blocks, but got %d", 2, coldCnt) } if hotCnt != 12 { - t.Errorf("expected %d blocks, but got %d", 12, hotCnt) + t.Fatalf("expected %d blocks, but got %d", 12, hotCnt) } // trigger a compaction diff --git a/blockstore/splitstore/splitstore_warmup.go b/blockstore/splitstore/splitstore_warmup.go index 1410751040..1dd64236d3 100644 --- a/blockstore/splitstore/splitstore_warmup.go +++ b/blockstore/splitstore/splitstore_warmup.go @@ -19,8 +19,6 @@ import ( var ( // WarmupBoundary is the number of epochs to load state during warmup. WarmupBoundary = policy.ChainFinality - // Empirically taken from December 2024 - MarkSetEstimate int64 = 10_000_000_000 ) // warmup acquires the compaction lock and spawns a goroutine to warm up the hotstore; @@ -37,12 +35,8 @@ func (s *SplitStore) warmup(curTs *types.TipSet) error { log.Info("warming up hotstore") start := time.Now() - var err error - if s.cfg.FullWarmup { - err = s.doWarmup(curTs) - } else { - err = s.doWarmup2(curTs) - } + err := s.doWarmup(curTs) + if err != nil { log.Errorf("error warming up hotstore: %s", err) return @@ -54,36 +48,11 @@ func (s *SplitStore) warmup(curTs *types.TipSet) error { return nil } -// Warmup2 -func (s *SplitStore) doWarmup2(curTs *types.TipSet) error { - log.Infow("warmup starting") - - epoch := curTs.Height() - s.markSetSize = MarkSetEstimate - err := s.ds.Put(s.ctx, markSetSizeKey, int64ToBytes(s.markSetSize)) - if err != nil { - log.Warnf("error saving mark set size: %s", err) - } - - // save the warmup epoch - err = s.ds.Put(s.ctx, warmupEpochKey, epochToBytes(epoch)) - if err != nil { - return xerrors.Errorf("error saving warm up epoch: %w", err) - } - s.warmupEpoch.Store(int64(epoch)) - - // also save the compactionIndex, as this is used as an indicator of warmup for upgraded nodes - err = s.ds.Put(s.ctx, compactionIndexKey, int64ToBytes(s.compactionIndex)) - if err != nil { - return xerrors.Errorf("error saving compaction index: %w", err) - } - return nil -} - // the full warmup procedure -// this was standard warmup before we wrote snapshots directly to the hotstore -// now this is used only if explicitly configured. A good use case for this is -// when starting splitstore off of an unpruned full node. +// Most of this is unnecessary in the common case where we are starting from a snapshot +// since snapshots are now loaded directly to the hotstore. However this is safe and robust, +// handling all cases where we are transition from a universal setup to a splitstore setup. +// And warmup costs are only paid on init so it is not func (s *SplitStore) doWarmup(curTs *types.TipSet) error { var boundaryEpoch abi.ChainEpoch epoch := curTs.Height() diff --git a/node/config/def.go b/node/config/def.go index 3f0c30272b..e6bdc04bdb 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -75,7 +75,6 @@ func DefaultFullNode() *FullNode { ColdStoreType: "discard", HotStoreType: "badger", MarkSetType: "badger", - FullWarmup: false, HotStoreFullGCFrequency: 20, HotStoreMaxSpaceTarget: 650_000_000_000, diff --git a/node/config/types.go b/node/config/types.go index 626f74029f..3824427b2a 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -523,12 +523,6 @@ type Splitstore struct { // is set. Moving GC will not occur when total moving size exceeds // HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer HotstoreMaxSpaceSafetyBuffer uint64 - - // Perform a full warmup from the coldstore to the hotstore upon splitstore startup. - // This is useful in the case you are migrating from a non-splitstore setup to splitstore. - // This should be false in the common case where a node is initialized from a snapshot - // since snapshots are loaded directly to the hotstore. - FullWarmup bool } // Full Node diff --git a/node/modules/blockstore.go b/node/modules/blockstore.go index 2ff18f956e..ac16a0f7e7 100644 --- a/node/modules/blockstore.go +++ b/node/modules/blockstore.go @@ -65,7 +65,6 @@ func SplitBlockstore(cfg *config.Chainstore) func(lc fx.Lifecycle, r repo.Locked MarkSetType: cfg.Splitstore.MarkSetType, DiscardColdBlocks: cfg.Splitstore.ColdStoreType == "discard", UniversalColdBlocks: cfg.Splitstore.ColdStoreType == "universal", - FullWarmup: cfg.Splitstore.FullWarmup, HotStoreMessageRetention: cfg.Splitstore.HotStoreMessageRetention, HotStoreFullGCFrequency: cfg.Splitstore.HotStoreFullGCFrequency,