Skip to content

Commit

Permalink
integration: run_migration must not use Accede mode (erigontech#8867)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Dec 2, 2023
1 parent e7e1bf4 commit 2991a6b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cmd/integration/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,18 @@ func RootCommand() *cobra.Command {
func dbCfg(label kv.Label, path string) kv2.MdbxOpts {
const ThreadsLimit = 9_000
limiterB := semaphore.NewWeighted(ThreadsLimit)
opts := kv2.NewMDBX(log.New()).Path(path).Label(label).RoTxsLimiter(limiterB).Accede()
//if label == kv.ChainDB {
// opts = opts.MapSize(8 * datasize.TB)
//}
opts := kv2.NewMDBX(log.New()).Path(path).Label(label).RoTxsLimiter(limiterB)
// integration tool don't intent to create db, then easiest way to open db - it's pass mdbx.Accede flag, which allow
// to read all options from DB, instead of overriding them
opts = opts.Accede()

if databaseVerbosity != -1 {
opts = opts.DBVerbosity(kv.DBVerbosityLvl(databaseVerbosity))
}
return opts
}

func openDB(opts kv2.MdbxOpts, applyMigrations bool, logger log.Logger) (kv.RwDB, error) {
// integration tool don't intent to create db, then easiest way to open db - it's pass mdbx.Accede flag, which allow
// to read all options from DB, instead of overriding them
opts = opts.Accede()

db := opts.MustOpen()
if applyMigrations {
migrator := migrations.NewMigrator(opts.GetLabel())
Expand Down

0 comments on commit 2991a6b

Please sign in to comment.