v1.2_bolt #3

Closed
dstepanov-yadro wants to merge 2 commits from v1.2_bolt into support/v0.36
5 changed files with 5 additions and 3 deletions

2
go.mod
View file

@ -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

BIN
go.sum

Binary file not shown.

View file

@ -47,6 +47,7 @@ func defaultCfg(c *cfg) {
perm: os.ModePerm, // 0777
boltOptions: &bbolt.Options{
Timeout: 100 * time.Millisecond,
FreelistType: bbolt.FreelistMapType,
},
},
fullSizeLimit: 1 << 30, // 1GB

View file

@ -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
}

View file

@ -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 {