From f3b12fdc8edb99bcdd231bf8af65b5a6a164c97d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 26 Nov 2024 11:37:41 +0300 Subject: [PATCH] object/put: log meta errors instead of erroring out We don't have this finished yet, so it'd be safer for 0.44.0 to just log any errors, but continue working as it worked before. Signed-off-by: Roman Khimov --- pkg/services/object/put/distributed.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/services/object/put/distributed.go b/pkg/services/object/put/distributed.go index a124ae80d8..930c2c0012 100644 --- a/pkg/services/object/put/distributed.go +++ b/pkg/services/object/put/distributed.go @@ -13,7 +13,6 @@ import ( "github.com/nspcc-dev/neofs-node/pkg/network" svcutil "github.com/nspcc-dev/neofs-node/pkg/services/object/util" "github.com/nspcc-dev/neofs-node/pkg/util" - apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status" neofscrypto "github.com/nspcc-dev/neofs-sdk-go/crypto" "github.com/nspcc-dev/neofs-sdk-go/netmap" objectSDK "github.com/nspcc-dev/neofs-sdk-go/object" @@ -165,17 +164,22 @@ func (t *distributedTarget) sendObject(node nodeDesc) error { } if t.localNodeInContainer && !node.local { + // These should technically be errors, but we don't have + // a complete implementation now, so errors are substituted with logs. + var l = t.placementIterator.log.With(zap.Stringer("oid", t.obj.GetID())) + if sig == nil { - return fmt.Errorf("%w: missing object meta signature", apistatus.ErrSignatureVerification) + l.Info("missing object meta signature") + return nil } if !bytes.Equal(sig.PublicKeyBytes(), node.info.PublicKey()) { - return fmt.Errorf("%w: public key differs in object meta signature", apistatus.ErrSignatureVerification) + l.Info("public key differs in object meta signature") + return nil } if !sig.Verify(t.objSharedMeta) { - return fmt.Errorf("%w: %s node did not pass the meta information verification", - apistatus.ErrSignatureVerification, network.StringifyGroup(node.info.AddressGroup())) + l.Info("meta signature verification failed", zap.String("node", network.StringifyGroup(node.info.AddressGroup()))) } }