forked from TrueCloudLab/frostfs-node
[#763] metabase: Add container objects counter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
226e84d782
commit
9c98fa6152
7 changed files with 535 additions and 49 deletions
|
@ -183,16 +183,8 @@ func (db *DB) insertObject(tx *bbolt.Tx, obj *objectSDK.Object, id []byte, si *o
|
|||
}
|
||||
|
||||
if !isParent {
|
||||
err = db.updateCounter(tx, phy, 1, true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not increase phy object counter: %w", err)
|
||||
}
|
||||
|
||||
// it is expected that putting an unavailable object is
|
||||
// impossible and should be handled on the higher levels
|
||||
err = db.updateCounter(tx, logical, 1, true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not increase logical object counter: %w", err)
|
||||
if err = db.incCounters(tx, cnr); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue