mdbx: fix gc "retry" issue (slowness of gc during commit) (#227)

* mdbx: fix gc "retry" issue (slowness of gc during commit)

* mdbx: fix gc "retry" issue (slowness of gc during commit)
This commit is contained in:
Alex Sharov 2022-01-11 15:12:20 +07:00 committed by GitHub
parent f92c12855d
commit e98482670a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

2
go.mod
View File

@ -16,7 +16,7 @@ require (
github.com/matryer/moq v0.2.3
github.com/spaolacci/murmur3 v1.1.0
github.com/stretchr/testify v1.7.0
github.com/torquem-ch/mdbx-go v0.22.2
github.com/torquem-ch/mdbx-go v0.22.3
github.com/ugorji/go/codec v1.1.13
go.uber.org/atomic v1.9.0
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519

4
go.sum
View File

@ -93,8 +93,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/torquem-ch/mdbx-go v0.22.2 h1:wl/eJaZeKqsqObfzXAurYuPozr4hkopJ1hELHXH+N8w=
github.com/torquem-ch/mdbx-go v0.22.2/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
github.com/torquem-ch/mdbx-go v0.22.3 h1:C6cj5BMZ74Mbkn/FjOKvz2lVDSJLm7pqYwQBsIT9T4Y=
github.com/torquem-ch/mdbx-go v0.22.3/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
github.com/ugorji/go v1.1.13 h1:nB3O5kBSQGjEQAcfe1aLUYuxmXdFKmYgBZhY32rQb6Q=
github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc=
github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4=

View File

@ -168,10 +168,8 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) {
}
}
if opts.augumentLimit == 0 {
opts.augumentLimit = 128 * 256 * 1024 // mdbx's default 256 * 1024
}
if err = env.SetOption(mdbx.OptRpAugmentLimit, opts.augumentLimit); err != nil {
const MAX_AUGMENT_LIMIT = 0x7fffFFFF
if err = env.SetOption(mdbx.OptRpAugmentLimit, MAX_AUGMENT_LIMIT); err != nil {
return nil, err
}
if err = os.MkdirAll(opts.path, 0744); err != nil {