diff --git a/CHANGELOG.md b/CHANGELOG.md index 82fe70989a..4a0d22217d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Changelog for NeoFS Node ### Fixed - Fail gracefully on error from config validation (#3037) +- Metabase resynchronization failure (#3039) ### Changed diff --git a/pkg/local_object_storage/metabase/put.go b/pkg/local_object_storage/metabase/put.go index ccca03426a..6b3185ce9e 100644 --- a/pkg/local_object_storage/metabase/put.go +++ b/pkg/local_object_storage/metabase/put.go @@ -10,6 +10,7 @@ import ( objectCore "github.com/nspcc-dev/neofs-node/pkg/core/object" storagelog "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/internal/log" "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util" + apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status" objectSDK "github.com/nspcc-dev/neofs-sdk-go/object" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" "go.etcd.io/bbolt" @@ -72,10 +73,13 @@ func (db *DB) put( exists, err := db.exists(tx, objectCore.AddressOf(obj), currEpoch) - if errors.As(err, &splitInfoError) { + switch { + case errors.As(err, &splitInfoError): exists = true // object exists, however it is virtual - } else if err != nil { - return err // return any error besides SplitInfoError + case errors.Is(err, ErrLackSplitInfo), errors.As(err, &apistatus.ObjectNotFound{}): + // OK, we're putting here. + case err != nil: + return err // return any other errors } // most right child and split header overlap parent so we have to