Skip to content

Commit

Permalink
object/put: log meta errors instead of erroring out (#3029)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Nov 26, 2024
2 parents f90a3d3 + f3b12fd commit 6f3ff4a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/services/object/put/distributed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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())))
}
}

Expand Down

0 comments on commit 6f3ff4a

Please sign in to comment.