mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 12:07:17 +00:00
mdbx_to_mdbx: clean table before load
This commit is contained in:
parent
bf8c916afe
commit
82b8455635
@ -413,7 +413,7 @@ func mdbxToMdbx(ctx context.Context, logger log.Logger, from, to string) error {
|
||||
src := mdbx2.NewMDBX(logger).Path(from).Flags(func(flags uint) uint { return mdbx.Readonly | mdbx.Accede }).MustOpen()
|
||||
dst := mdbx2.NewMDBX(logger).Path(to).
|
||||
WriteMap().
|
||||
Flags(func(flags uint) uint { return flags | mdbx.NoMemInit | mdbx.WriteMap }).
|
||||
Flags(func(flags uint) uint { return flags | mdbx.NoMemInit | mdbx.WriteMap | mdbx.Accede }).
|
||||
MustOpen()
|
||||
return kv2kv(ctx, src, dst)
|
||||
}
|
||||
@ -430,7 +430,7 @@ func kv2kv(ctx context.Context, src, dst kv.RwDB) error {
|
||||
}
|
||||
defer dstTx.Rollback()
|
||||
|
||||
commitEvery := time.NewTicker(30 * time.Second)
|
||||
commitEvery := time.NewTicker(5 * time.Minute)
|
||||
defer commitEvery.Stop()
|
||||
|
||||
var total uint64
|
||||
@ -440,6 +440,7 @@ func kv2kv(ctx context.Context, src, dst kv.RwDB) error {
|
||||
}
|
||||
|
||||
rawdbreset.WarmupTable(ctx, src, name)
|
||||
_ = dstTx.ClearBucket(name)
|
||||
c, err := dstTx.RwCursor(name)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user