skip moving cold blocks when running with a noop coldstore
it is a noop but it still takes (a lot of) time because it has to read all the cold blocks.
This commit is contained in:
parent
b87295db93
commit
68bc5d2291
@ -102,6 +102,12 @@ type Config struct {
|
||||
// This is necessary, and automatically set by DI in lotus node construction, if
|
||||
// you are running with a noop coldstore.
|
||||
HotHeaders bool
|
||||
|
||||
// SkipMoveColdBlocks indicates whether to skip moving cold blocks to the coldstore.
|
||||
// If the splitstore is running with a noop coldstore then this option is set to true
|
||||
// which skips moving (as it is a noop, but still takes time to read all the cold objects)
|
||||
// and directly purges cold blocks.
|
||||
SkipMoveColdBlocks bool
|
||||
}
|
||||
|
||||
// ChainAccessor allows the Splitstore to access the chain. It will most likely
|
||||
@ -1055,15 +1061,16 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
return xerrors.Errorf("compaction aborted")
|
||||
}
|
||||
|
||||
// 2.2 copy the cold objects to the coldstore
|
||||
log.Info("moving cold blocks to the coldstore")
|
||||
startMove := time.Now()
|
||||
err = s.moveColdBlocks(cold)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error moving cold blocks: %w", err)
|
||||
// 2.2 copy the cold objects to the coldstore -- if we have one
|
||||
if !s.cfg.SkipMoveColdBlocks {
|
||||
log.Info("moving cold blocks to the coldstore")
|
||||
startMove := time.Now()
|
||||
err = s.moveColdBlocks(cold)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error moving cold blocks: %w", err)
|
||||
}
|
||||
log.Infow("moving done", "took", time.Since(startMove))
|
||||
}
|
||||
log.Infow("moving done", "took", time.Since(startMove))
|
||||
|
||||
// 2.3 purge cold objects from the hotstore
|
||||
log.Info("purging cold objects from the hotstore")
|
||||
startPurge := time.Now()
|
||||
|
@ -78,9 +78,10 @@ func SplitBlockstore(cfg *config.Chainstore) func(lc fx.Lifecycle, r repo.Locked
|
||||
}
|
||||
|
||||
cfg := &splitstore.Config{
|
||||
TrackingStoreType: cfg.Splitstore.TrackingStoreType,
|
||||
MarkSetType: cfg.Splitstore.MarkSetType,
|
||||
HotHeaders: cfg.Splitstore.HotHeaders || cfg.Splitstore.ColdStoreType == "noop",
|
||||
TrackingStoreType: cfg.Splitstore.TrackingStoreType,
|
||||
MarkSetType: cfg.Splitstore.MarkSetType,
|
||||
HotHeaders: cfg.Splitstore.HotHeaders || cfg.Splitstore.ColdStoreType == "noop",
|
||||
SkipMoveColdBlocks: cfg.Splitstore.ColdStoreType == "noop",
|
||||
}
|
||||
ss, err := splitstore.Open(path, ds, hot, cold, cfg)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user