allow configure pagesize

This commit is contained in:
alex.sharov 2022-01-22 12:46:22 +07:00
parent 8791c5eb7a
commit ec2a482087
2 changed files with 8 additions and 3 deletions

View File

@ -81,9 +81,10 @@ type DBVerbosityLvl int8
type Label uint8
const (
ChainDB Label = 0
TxPoolDB Label = 1
SentryDB Label = 2
ChainDB Label = 0
TxPoolDB Label = 1
SentryDB Label = 2
ConsensusDB Label = 3
)
func (l Label) String() string {

View File

@ -169,6 +169,10 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) {
return nil, err
}
} else {
if opts.label == kv.ChainDB && opts.pageSize == 4096 {
panic(1)
}
fmt.Printf("al: %s, %d\n", opts.label, opts.pageSize)
if err = env.SetGeometry(-1, -1, int(opts.mapSize), int(2*datasize.GB), -1, int(opts.pageSize)); err != nil {
return nil, err
}