From 828c8695c1e286ae5af28c7ec42e55e16e169654 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 9 Apr 2021 12:18:38 +0300 Subject: [PATCH] [#472] blobstor: use `DB.Batch()` for metabase and blobstor Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/blobovnicza/put.go | 2 +- pkg/local_object_storage/metabase/put.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/local_object_storage/blobovnicza/put.go b/pkg/local_object_storage/blobovnicza/put.go index ef17827514..5f145ff5dc 100644 --- a/pkg/local_object_storage/blobovnicza/put.go +++ b/pkg/local_object_storage/blobovnicza/put.go @@ -51,7 +51,7 @@ func (b *Blobovnicza) Put(prm *PutPrm) (*PutRes, error) { return nil, errNilAddress } - err := b.boltDB.Update(func(tx *bbolt.Tx) error { + err := b.boltDB.Batch(func(tx *bbolt.Tx) error { if b.full() { return ErrFull } diff --git a/pkg/local_object_storage/metabase/put.go b/pkg/local_object_storage/metabase/put.go index f2e426a0f8..1ed9761730 100644 --- a/pkg/local_object_storage/metabase/put.go +++ b/pkg/local_object_storage/metabase/put.go @@ -67,7 +67,7 @@ func Put(db *DB, obj *object.Object, id *blobovnicza.ID) error { // Put saves object header in metabase. Object payload expected to be cut. // Big objects have nil blobovniczaID. func (db *DB) Put(prm *PutPrm) (res *PutRes, err error) { - err = db.boltDB.Update(func(tx *bbolt.Tx) error { + err = db.boltDB.Batch(func(tx *bbolt.Tx) error { return db.put(tx, prm.obj, prm.id, nil) })