Skip to content

Commit

Permalink
object/put: log meta errors instead of erroring out
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
roman-khimov committed Nov 26, 2024
1 parent f90a3d3 commit f3b12fd
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()))

Check warning on line 170 in pkg/services/object/put/distributed.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/object/put/distributed.go#L167-L170

Added lines #L167 - L170 were not covered by tests
if sig == nil {
return fmt.Errorf("%w: missing object meta signature", apistatus.ErrSignatureVerification)
l.Info("missing object meta signature")
return nil

Check warning on line 173 in pkg/services/object/put/distributed.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/object/put/distributed.go#L172-L173

Added lines #L172 - L173 were not covered by tests
}

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

Check warning on line 178 in pkg/services/object/put/distributed.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/object/put/distributed.go#L177-L178

Added lines #L177 - L178 were not covered by tests
}

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())))

Check warning on line 182 in pkg/services/object/put/distributed.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/object/put/distributed.go#L182

Added line #L182 was not covered by tests
}
}

Expand Down

0 comments on commit f3b12fd

Please sign in to comment.