diff --git a/go.mod b/go.mod index b588298db..89922b9d7 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.15.0 github.com/stretchr/testify v1.8.2 - go.etcd.io/bbolt v1.3.6 + go.etcd.io/bbolt v1.3.7 go.opentelemetry.io/otel v1.14.0 go.opentelemetry.io/otel/trace v1.14.0 go.uber.org/atomic v1.10.0 diff --git a/go.sum b/go.sum index ed5657fed..b2b34d7f5 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/local_object_storage/blobovnicza/blobovnicza.go b/pkg/local_object_storage/blobovnicza/blobovnicza.go index a49324406..fd7a55c44 100644 --- a/pkg/local_object_storage/blobovnicza/blobovnicza.go +++ b/pkg/local_object_storage/blobovnicza/blobovnicza.go @@ -46,7 +46,8 @@ func defaultCfg(c *cfg) { boltDBCfg: boltDBCfg{ perm: os.ModePerm, // 0777 boltOptions: &bbolt.Options{ - Timeout: 100 * time.Millisecond, + Timeout: 100 * time.Millisecond, + FreelistType: bbolt.FreelistMapType, }, }, fullSizeLimit: 1 << 30, // 1GB diff --git a/pkg/local_object_storage/blobovnicza/put.go b/pkg/local_object_storage/blobovnicza/put.go index 37ed57e1c..5b09f4ea8 100644 --- a/pkg/local_object_storage/blobovnicza/put.go +++ b/pkg/local_object_storage/blobovnicza/put.go @@ -52,7 +52,7 @@ func (b *Blobovnicza) Put(prm PutPrm) (PutRes, error) { bucketName := bucketForSize(sz) key := addressKey(prm.addr) - err := b.boltDB.Batch(func(tx *bbolt.Tx) error { + err := b.boltDB.Update(func(tx *bbolt.Tx) error { if b.full() { return ErrFull } diff --git a/pkg/local_object_storage/pilorama/boltdb.go b/pkg/local_object_storage/pilorama/boltdb.go index 8f1574b5f..5b47c545a 100644 --- a/pkg/local_object_storage/pilorama/boltdb.go +++ b/pkg/local_object_storage/pilorama/boltdb.go @@ -109,6 +109,7 @@ func (t *boltForest) Open(readOnly bool) error { opts.NoSync = t.noSync opts.Timeout = 100 * time.Millisecond opts.OpenFile = t.openFile + opts.FreelistType = bbolt.FreelistMapType t.db, err = bbolt.Open(t.path, t.perm, &opts) if err != nil {