[#1699] meta: Do not return SplitInfoError on Delete

It is not an error: removing virtual object is expected and should be just
skipped. Getting a virtual object with `raw` flag is considered as an
impossible action, all the virtual objects removals will be handled via
their children's removals implicitly.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-09-04 11:52:01 +03:00 committed by fyrchik
parent 9cd8441dd5
commit 7a75b3aaaf
3 changed files with 7 additions and 3 deletions

View file

@ -12,6 +12,7 @@ Changelog for NeoFS Node
- `neofs-cli container nodes`'s output (#1991) - `neofs-cli container nodes`'s output (#1991)
- Do not panic with bad inputs for `GET_RANGE` (#2007) - Do not panic with bad inputs for `GET_RANGE` (#2007)
- Correctly select the shard for applying tree service operations (#1996) - Correctly select the shard for applying tree service operations (#1996)
- Physical child object removal by GC (#1699)
### Removed ### Removed
### Updated ### Updated

View file

@ -157,7 +157,10 @@ func (db *DB) delete(tx *bbolt.Tx, addr oid.Address, refCounter referenceCounter
// unmarshal object, work only with physically stored (raw == true) objects // unmarshal object, work only with physically stored (raw == true) objects
obj, err := db.get(tx, addr, key, false, true, currEpoch) obj, err := db.get(tx, addr, key, false, true, currEpoch)
if err != nil { if err != nil {
if errors.As(err, new(apistatus.ObjectNotFound)) { var siErr *objectSDK.SplitInfoError
var notFoundErr apistatus.ObjectNotFound
if errors.As(err, &notFoundErr) || errors.As(err, &siErr) {
return false, false, nil return false, false, nil
} }

View file

@ -39,9 +39,9 @@ func TestDB_Delete(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.Len(t, l, 1) require.Len(t, l, 1)
// try to remove parent unsuccessfully // try to remove parent, should be no-op, error-free
err = metaDelete(db, object.AddressOf(parent)) err = metaDelete(db, object.AddressOf(parent))
require.Error(t, err) require.NoError(t, err)
// inhume parent and child so they will be on graveyard // inhume parent and child so they will be on graveyard
ts := generateObjectWithCID(t, cnr) ts := generateObjectWithCID(t, cnr)