[#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>
remotes/fyrchik/remove-useless-logs
Pavel Karpy 2022-09-04 11:52:01 +03:00 committed by fyrchik
parent a3e7365cbd
commit 2849e465f9
3 changed files with 7 additions and 3 deletions

View File

@ -16,6 +16,7 @@ Changelog for NeoFS Node
- Increase error counter for write-cache flush errors (#1818)
- Correctly select the shard for applying tree service operations (#1996)
- Do not panic with bad inputs for `GET_RANGE` (#2007)
- Physical child object removal by GC (#1699)
### Removed
### 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
obj, err := db.get(tx, addr, key, false, true, currEpoch)
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
}

View File

@ -39,9 +39,9 @@ func TestDB_Delete(t *testing.T) {
require.NoError(t, err)
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))
require.Error(t, err)
require.NoError(t, err)
// inhume parent and child so they will be on graveyard
ts := generateObjectWithCID(t, cnr)