diff --git a/blockstore/splitstore/markset_map.go b/blockstore/splitstore/markset_map.go index 52efcb8a48..922800eafa 100644 --- a/blockstore/splitstore/markset_map.go +++ b/blockstore/splitstore/markset_map.go @@ -42,6 +42,11 @@ func NewMapMarkSetEnv(path string) (*MapMarkSetEnv, error) { func (e *MapMarkSetEnv) New(name string, sizeHint int64) (MarkSet, error) { path := filepath.Join(e.path, name) + // Limit map size to 1k if sizeHint exceeds this value + // This prevents accidental hanging when sizeHint is too large + if sizeHint > 1000 { + sizeHint = 1000 + } return &MapMarkSet{ set: make(map[string]struct{}, sizeHint), path: path, diff --git a/blockstore/splitstore/splitstore_warmup.go b/blockstore/splitstore/splitstore_warmup.go index e57ea25a52..1410751040 100644 --- a/blockstore/splitstore/splitstore_warmup.go +++ b/blockstore/splitstore/splitstore_warmup.go @@ -59,10 +59,7 @@ func (s *SplitStore) doWarmup2(curTs *types.TipSet) error { log.Infow("warmup starting") epoch := curTs.Height() - count := new(int64) - // Empirically taken from December 2024 - *count = MarkSetEstimate - s.markSetSize = *count + *count>>2 // overestimate a bit + 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)