reintroduce compaction slack
This commit is contained in:
parent
a178c1fb93
commit
a25ac80777
@ -35,10 +35,11 @@ var (
|
|||||||
//
|
//
|
||||||
// |················· CompactionThreshold ··················|
|
// |················· CompactionThreshold ··················|
|
||||||
// | |
|
// | |
|
||||||
// =======‖≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡‖|------------------------»
|
// =======‖≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡‖----------|------------------------»
|
||||||
// | | chain --> ↑__ current epoch
|
// | | | chain --> ↑__ current epoch
|
||||||
// | archived epochs |
|
// | archived epochs ___↑ |
|
||||||
// ↑________ CompactionBoundary
|
// | ↑________ CompactionBoundary
|
||||||
|
// ↑__ CompactionSlack
|
||||||
//
|
//
|
||||||
// === :: cold (already archived)
|
// === :: cold (already archived)
|
||||||
// ≡≡≡ :: to be archived in this compaction
|
// ≡≡≡ :: to be archived in this compaction
|
||||||
@ -49,6 +50,10 @@ var (
|
|||||||
// we will walk the chain for live objects.
|
// we will walk the chain for live objects.
|
||||||
CompactionBoundary = 2 * build.Finality
|
CompactionBoundary = 2 * build.Finality
|
||||||
|
|
||||||
|
// CompactionSlack is the number of epochs from the compaction boundary to the beginning
|
||||||
|
// of the cold epoch.
|
||||||
|
CompactionSlack = build.Finality
|
||||||
|
|
||||||
// SyncGapTime is the time delay from a tipset's min timestamp before we decide
|
// SyncGapTime is the time delay from a tipset's min timestamp before we decide
|
||||||
// there is a sync gap
|
// there is a sync gap
|
||||||
SyncGapTime = time.Minute
|
SyncGapTime = time.Minute
|
||||||
@ -738,7 +743,7 @@ func (s *SplitStore) estimateMarkSetSize(curTs *types.TipSet) error {
|
|||||||
func (s *SplitStore) doCompact(curTs *types.TipSet, syncGapEpoch abi.ChainEpoch) error {
|
func (s *SplitStore) doCompact(curTs *types.TipSet, syncGapEpoch abi.ChainEpoch) error {
|
||||||
currentEpoch := curTs.Height()
|
currentEpoch := curTs.Height()
|
||||||
boundaryEpoch := currentEpoch - CompactionBoundary
|
boundaryEpoch := currentEpoch - CompactionBoundary
|
||||||
coldEpoch := boundaryEpoch - 1
|
coldEpoch := boundaryEpoch - CompactionSlack
|
||||||
|
|
||||||
log.Infow("running compaction", "currentEpoch", currentEpoch, "baseEpoch", s.baseEpoch, "coldEpoch", coldEpoch, "boundaryEpoch", boundaryEpoch)
|
log.Infow("running compaction", "currentEpoch", currentEpoch, "baseEpoch", s.baseEpoch, "coldEpoch", coldEpoch, "boundaryEpoch", boundaryEpoch)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user