remove code of exeriments (#6187)

This commit is contained in:
Alex Sharov 2022-12-03 13:04:09 +07:00 committed by GitHub
parent f9c8d556a5
commit ded79088e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 29 deletions

View File

@ -5,7 +5,6 @@ import (
"runtime" "runtime"
"github.com/c2h5oh/datasize" "github.com/c2h5oh/datasize"
"github.com/ledgerwatch/erigon-lib/common/dbg"
"github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv"
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx" kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
"github.com/ledgerwatch/erigon/cmd/utils" "github.com/ledgerwatch/erigon/cmd/utils"
@ -56,18 +55,6 @@ func openDB(opts kv2.MdbxOpts, applyMigrations bool) kv.RwDB {
// to read all options from DB, instead of overriding them // to read all options from DB, instead of overriding them
opts = opts.Flags(func(f uint) uint { return f | mdbx.Accede }) opts = opts.Flags(func(f uint) uint { return f | mdbx.Accede })
if dbg.WriteMap() {
opts = opts.WriteMap()
}
if dbg.MergeTr() > 0 {
opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192))
}
if dbg.MdbxReadAhead() {
opts = opts.Flags(func(u uint) uint {
return u &^ mdbx.NoReadahead
})
}
db := opts.MustOpen() db := opts.MustOpen()
if applyMigrations { if applyMigrations {
migrator := migrations.NewMigrator(opts.GetLabel()) migrator := migrations.NewMigrator(opts.GetLabel())

View File

@ -28,10 +28,8 @@ import (
"sync" "sync"
"github.com/c2h5oh/datasize" "github.com/c2h5oh/datasize"
"github.com/ledgerwatch/erigon-lib/common/dbg"
"github.com/ledgerwatch/erigon/node/nodecfg" "github.com/ledgerwatch/erigon/node/nodecfg"
"github.com/ledgerwatch/erigon/params" "github.com/ledgerwatch/erigon/params"
mdbx2 "github.com/torquem-ch/mdbx-go/mdbx"
"golang.org/x/sync/semaphore" "golang.org/x/sync/semaphore"
"github.com/gofrs/flock" "github.com/gofrs/flock"
@ -339,20 +337,6 @@ func OpenDatabase(config *nodecfg.Config, logger log.Logger, label kv.Label) (kv
} else { } else {
opts = opts.GrowthStep(16 * datasize.MB) opts = opts.GrowthStep(16 * datasize.MB)
} }
if dbg.WriteMap() {
log.Info("[db] Enabling WriteMap")
opts = opts.WriteMap()
}
if dbg.MergeTr() > 0 {
log.Info("[db] Setting", "MergeThreshold", dbg.MergeTr())
opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192))
}
if dbg.MdbxReadAhead() {
log.Info("[db] Setting Enabling ReadAhead")
opts = opts.Flags(func(u uint) uint {
return u &^ mdbx2.NoReadahead
})
}
return opts.Open() return opts.Open()
} }
var err error var err error