caplin: to use 1 worker for snapshots compression (#8892)

Erigon by default must use as minimum resources as possible to build
snapshots. But cli commands - can go opposite and maximize.
This commit is contained in:
Alex Sharov 2023-12-04 18:55:40 +07:00 committed by GitHub
parent fcb9fce5d0
commit 49890b38b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -201,7 +201,7 @@ func (a *Antiquary) antiquate(from, to uint64) error {
return nil // Just skip if we don't have a downloader
}
log.Info("[Antiquary]: Antiquating", "from", from, "to", to)
if err := freezeblocks.DumpBeaconBlocks(a.ctx, a.mainDB, a.beaconDB, from, to, snaptype.Erigon2RecentMergeLimit, a.dirs.Tmp, a.dirs.Snap, 8, log.LvlDebug, a.logger); err != nil {
if err := freezeblocks.DumpBeaconBlocks(a.ctx, a.mainDB, a.beaconDB, from, to, snaptype.Erigon2RecentMergeLimit, a.dirs.Tmp, a.dirs.Snap, 1, log.LvlDebug, a.logger); err != nil {
return err
}

View File

@ -7,6 +7,7 @@ import (
"strings"
"time"
"github.com/ledgerwatch/erigon/eth/ethconfig/estimate"
"github.com/ledgerwatch/erigon/turbo/debug"
lg "github.com/anacrolix/log"
@ -456,7 +457,7 @@ func (c *DumpSnapshots) Run(ctx *Context) error {
return
})
return freezeblocks.DumpBeaconBlocks(ctx, db, beaconDB, 0, to, snaptype.Erigon2RecentMergeLimit, dirs.Tmp, dirs.Snap, 8, log.LvlInfo, log.Root())
return freezeblocks.DumpBeaconBlocks(ctx, db, beaconDB, 0, to, snaptype.Erigon2RecentMergeLimit, dirs.Tmp, dirs.Snap, estimate.CompressSnapshot.Workers(), log.LvlInfo, log.Root())
}
type CheckSnapshots struct {