-
Notifications
You must be signed in to change notification settings - Fork 38
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
Use new API for background replication #2674
Conversation
98848f5
to
450912e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2674 +/- ##
==========================================
+ Coverage 22.00% 22.13% +0.12%
==========================================
Files 791 793 +2
Lines 47297 47586 +289
==========================================
+ Hits 10410 10535 +125
- Misses 35993 36147 +154
- Partials 894 904 +10 ☔ View full report in Codecov by Sentry. |
0b915af
to
3a95318
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you point me to the place where ACLs are checked?
d1aef55
to
152b8a6
Compare
152b8a6
to
0a8d61a
Compare
0a8d61a
to
2317ec8
Compare
nspcc-dev/neofs-sdk-go@3f513ed is really desired. But we have current problem with SDK upgrades. So we should either w8 4 #2716 to be able to test this in master or postpone signature optimization |
2317ec8
to
fbac66d
Compare
maxRecvSize, math.MaxInt)) | ||
} | ||
maxRecvMsgSizeOpt = grpc.MaxRecvMsgSize(int(maxRecvSize)) | ||
c.log.Debug("limit max recv gRPC message size to fit max stored objects", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be info, imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can ofc, do or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave it to Debug
for now.
switch req.Signature.Scheme { | ||
// other cases already checked above | ||
case refs.SignatureScheme_ECDSA_SHA512: | ||
pubKey = new(neofsecdsa.PublicKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can have some generic func here, since this parsing routine is the same for all the keys (even err message is the same). not needed to have 3 cases then, all can be done in a single branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this parsing routine is the same for all the keys (even err message is the same)
these are different cases, looks similar (now) - yeah, but not the same. I dont think separate function will make code easier to understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but how can they differ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response (message, status details) can depend on particular scheme. The fact that i've made them similar doesnt mean all branches are the same. Current code shows what differs (overall) for different schemes - public key implementation and response messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesnt mean all branches are the same
but all branches are the same now
} | ||
|
||
var clientInCnr, serverInCnr bool | ||
err = s.node.ForEachContainerNodePublicKeyInLastTwoEpochs(cnr, func(pubKey []byte) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is the only call, do we need this interface to be that complex? can it just answers if some key(s) belons to a container in the last two epochs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this'd have inconvenient interface like M(cid.ID, [][]byte) ([]bool, error)
. Current method is more reusable and clear to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, you added two methods to implement a single functionality (and the first one is used to make the second one usable). it is undesired complexity to me
more reusable
well, not sure it'll be reused ever (just iterate container keys? why?)
but generally not that critical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just iterate container keys? why?
key-container relationship is a widely demanded operation in NeoFS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key-container relationship
this is a "bool" relation, my thread is about it
fbac66d
to
ecb3a89
Compare
Some conflicts also. |
a657f79
to
6e935b8
Compare
rebased, cut placement caches and checked still works. Left several refactor issues for the future. All rdy for merge |
NeoFS protocol has been recently extended with new object replication RPC `ObjectService.Replicate` separated from the general-purpose `ObjectService.Put` one. According to API of the new RPC, all physically stored objects are transmitted in one message. Also, replication request and response formats are much simpler than for other operations. Serve new RPC by the storage node app. Requests are served similar to `ObjectService.Put` ones with TTL=1 (local only). Refs #2317. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
It's more lightweight and supports binary copying without additional decode-encode round. Based on the fact that if the object is fixed, the request remains unchanged. According to this, transport message is encoded once and sent to all nodes. Closes #2317. Refs #2316. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
6e935b8
to
5ba2dea
Compare
}}, nil | ||
} else if !serverInCnr { | ||
return &objectGRPC.ReplicateResponse{Status: &status.Status{ | ||
Code: codeAccessDenied, Message: "server does not match the object's storage policy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not line per field?
replication demux inside PUT is planned for the next PR