Skip to content

Commit

Permalink
make gen
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenGround0 committed Aug 5, 2022
1 parent 8b24cd0 commit 9c247ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 1 addition & 3 deletions blockstore/splitstore/splitstore_compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package splitstore
import (
"bytes"
"errors"
"fmt"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -84,7 +83,6 @@ func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error {
epoch := curTs.Height()

log.Warnf("Head epoch %d", epoch)
fmt.Printf("auto prune enabled: %t, gap %d from pruneEpoch %d, compaction index %d\n", s.cfg.EnableColdStoreAutoPrune, epoch-s.pruneEpoch, s.pruneEpoch, s.compactionIndex)

// NOTE: there is an implicit invariant assumption that HeadChange is invoked
// synchronously and no other HeadChange can be invoked while one is in
Expand Down Expand Up @@ -161,7 +159,7 @@ func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error {
return depth <= int64(CompactionBoundary)
}
}
movingGC := s.cfg.HotStoreFullGCFrequency > 0 && s.pruneIndex%int64(s.cfg.ColdStoreFullGCFrequency) == 0
movingGC := s.cfg.ColdStoreFullGCFrequency > 0 && s.pruneIndex%int64(s.cfg.ColdStoreFullGCFrequency) == 0
var gcOpts []bstore.BlockstoreGCOption
if movingGC {
gcOpts = append(gcOpts, bstore.WithFullGC(true))
Expand Down
17 changes: 16 additions & 1 deletion documentation/en/default-lotus-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,27 @@
# env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREFULLGCFREQUENCY
#HotStoreFullGCFrequency = 20

# EnableColdStoreAutoPrune turns on compaction of the cold store i.e. pruning
# where hotstore compaction occurs every finality epochs pruning happens every 3 finalities
# Default is false
#
# type: bool
# env var: LOTUS_CHAINSTORE_SPLITSTORE_ENABLECOLDSTOREAUTOPRUNE
#EnableColdStoreAutoPrune = false

# ColdStoreFullGCFrequency specifies how often to performa a full (moving) GC on the coldstore.
# Only applies if auto prune is enabled. A value of 0 disables while a value of 1 will do
# full GC in every prune.
# Default is 7 (about once every a week)
#
# type: uint64
# env var: LOTUS_CHAINSTORE_SPLITSTORE_COLDSTOREFULLGCFREQUENCY
#ColdStoreFullGCFrequency = 0
#ColdStoreFullGCFrequency = 7

# ColdStoreRetention specifies the retention policy for data reachable from the chain, in
# finalities beyond the compaction boundary, default is 0, -1 retains everything
#
# type: int64
# env var: LOTUS_CHAINSTORE_SPLITSTORE_COLDSTORERETENTION
#ColdStoreRetention = 0

Expand Down

0 comments on commit 9c247ca

Please sign in to comment.