From 87d5a3723ffc7a3c584cbd14a889a5c9128dafa8 Mon Sep 17 00:00:00 2001 From: zenground0 Date: Thu, 9 Mar 2023 08:57:14 -0700 Subject: [PATCH] lint --- blockstore/splitstore/splitstore_gc.go | 6 +----- node/config/doc_gen.go | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/blockstore/splitstore/splitstore_gc.go b/blockstore/splitstore/splitstore_gc.go index f6087205d..2ddb7d404 100644 --- a/blockstore/splitstore/splitstore_gc.go +++ b/blockstore/splitstore/splitstore_gc.go @@ -8,10 +8,6 @@ import ( ) const ( - // When < 150 GB of space would remain during moving GC, trigger moving GC - targetThreshold = 150_000_000_000 - // Don't attempt moving GC with 50 GB or less would remain during moving GC - targetBuffer = 50_000_000_000 // Fraction of garbage in badger vlog for online GC traversal to collect garbage AggressiveOnlineGCThreshold = 0.0001 ) @@ -55,7 +51,7 @@ func (s *SplitStore) gcHotAfterCompaction() { if shouldDoFull && canDoFull { opts = append(opts, bstore.WithFullGC(true)) } else if shouldDoFull && !canDoFull { - log.Warnf("Attention! Estimated moving GC size %d is not within safety buffer %d of target max %d, performing aggressive online GC to attempt to bring hotstore size down safely", copySizeApprox, targetBuffer, s.cfg.HotstoreMaxSpaceTarget) + log.Warnf("Attention! Estimated moving GC size %d is not within safety buffer %d of target max %d, performing aggressive online GC to attempt to bring hotstore size down safely", copySizeApprox, s.cfg.HotstoreMaxSpaceSafetyBuffer, s.cfg.HotstoreMaxSpaceTarget) log.Warn("If problem continues you can 1) temporarily allocate more disk space to hotstore and 2) reflect in HotstoreMaxSpaceTarget OR trigger manual move with `lotus chain prune hot-moving`") log.Warn("If problem continues and you do not have any more disk space you can run continue to manually trigger online GC at aggressive thresholds (< 0.01) with `lotus chain prune hot`") diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index f5a89293c..c62084708 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -1300,6 +1300,21 @@ A reasonable minimum is 2x fully GCed hotstore size + 50 G buffer. At this minimum size moving GC happens every time, any smaller and moving GC won't be able to run. In spring 2023 this minimum is ~550 GB.`, }, + { + Name: "HotStoreMaxSpaceThreshold", + Type: "uint64", + + Comment: `When HotStoreMaxSpaceTarget is set Moving GC will be triggered when total moving size +exceeds HotstoreMaxSpaceTarget - HotstoreMaxSpaceThreshold`, + }, + { + Name: "HotstoreMaxSpaceSafetyBuffer", + Type: "uint64", + + Comment: `Safety buffer to prevent moving GC from overflowing disk when HotStoreMaxSpaceTarget +is set. Moving GC will not occur when total moving size exceeds +HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer`, + }, }, "StorageMiner": []DocField{ {