erigon init: created db with wrong pageSize (#7482)

This commit is contained in:
Alex Sharov 2023-05-10 12:08:39 +07:00 committed by GitHub
parent f23612bdfe
commit b84561c163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,7 +313,12 @@ func OpenDatabase(config *nodecfg.Config, label kv.Label) (kv.RwDB, error) {
opts = opts.Exclusive()
}
if label == kv.ChainDB {
opts = opts.PageSize(config.MdbxPageSize.Bytes()).MapSize(config.MdbxDBSizeLimit)
if config.MdbxPageSize.Bytes() > 0 {
opts = opts.PageSize(config.MdbxPageSize.Bytes())
}
if config.MdbxDBSizeLimit > 0 {
opts = opts.MapSize(config.MdbxDBSizeLimit)
}
} else {
opts = opts.GrowthStep(16 * datasize.MB)
}