From e98482670aeb34cac7786df9eeb401bb0476f414 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Tue, 11 Jan 2022 15:12:20 +0700 Subject: [PATCH] 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) --- go.mod | 2 +- go.sum | 4 ++-- kv/mdbx/kv_mdbx.go | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 2bfee7741..1ac2d28a0 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index bb5c1913f..d8e886fbc 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/kv/mdbx/kv_mdbx.go b/kv/mdbx/kv_mdbx.go index 708f57b6e..7b4bbbe20 100644 --- a/kv/mdbx/kv_mdbx.go +++ b/kv/mdbx/kv_mdbx.go @@ -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 {