forked from TrueCloudLab/frostfs-node
v1.2_bolt #3
5 changed files with 5 additions and 3 deletions
2
go.mod
2
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
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue