[#964] metabase: Drop GC marks if object not found
GC inhumes expired locks and tombstones on all the shards. So it could be GC mark without object. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
c3fa902780
commit
cfc5ce7853
2 changed files with 42 additions and 2 deletions
|
@ -254,9 +254,18 @@ func (db *DB) delete(tx *bbolt.Tx, addr oid.Address, refCounter referenceCounter
|
|||
// unmarshal object, work only with physically stored (raw == true) objects
|
||||
obj, err := db.get(tx, addr, key, false, true, currEpoch)
|
||||
if err != nil {
|
||||
if client.IsErrObjectNotFound(err) {
|
||||
addrKey = addressKey(addr, key)
|
||||
if garbageBKT != nil {
|
||||
err := garbageBKT.Delete(addrKey)
|
||||
if err != nil {
|
||||
return deleteSingleResult{}, fmt.Errorf("could not remove from garbage bucket: %w", err)
|
||||
}
|
||||
}
|
||||
return deleteSingleResult{}, nil
|
||||
}
|
||||
var siErr *objectSDK.SplitInfoError
|
||||
|
||||
if client.IsErrObjectNotFound(err) || errors.As(err, &siErr) {
|
||||
if errors.As(err, &siErr) {
|
||||
// if object is virtual (parent) then do nothing, it will be deleted with last child
|
||||
return deleteSingleResult{}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue