Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object/put: log meta errors instead of erroring out #3029

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
"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 @@
}

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
Loading