forked from TrueCloudLab/frostfs-node
[#602] blobovnicza: Fix size counter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
2e49d7ea7e
commit
809e97626b
7 changed files with 99 additions and 52 deletions
|
@ -61,7 +61,7 @@ func (b *Blobovnicza) Put(ctx context.Context, prm PutPrm) (PutRes, error) {
|
|||
defer span.End()
|
||||
|
||||
sz := uint64(len(prm.objData))
|
||||
bucketName := bucketForSize(sz)
|
||||
bucketName, upperBound := bucketForSize(sz)
|
||||
key := addressKey(prm.addr)
|
||||
|
||||
err := b.boltDB.Batch(func(tx *bbolt.Tx) error {
|
||||
|
@ -85,7 +85,7 @@ func (b *Blobovnicza) Put(ctx context.Context, prm PutPrm) (PutRes, error) {
|
|||
return nil
|
||||
})
|
||||
if err == nil {
|
||||
b.incSize(sz)
|
||||
b.incSize(upperBound)
|
||||
}
|
||||
|
||||
return PutRes{}, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue