Optimize buffering of forwarded SEARCH requests - #4116
Conversation
4347a87 to
1695f41
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4116 +/- ##
==========================================
- Coverage 30.10% 30.08% -0.02%
==========================================
Files 679 679
Lines 40886 40893 +7
==========================================
- Hits 12310 12304 -6
- Misses 28576 28589 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1695f41 to
5d595c6
Compare
roman-khimov
left a comment
There was a problem hiding this comment.
We need to share this code with SDK, it's unmaintainable otherwise.
this is planned to be done in #4005 |
|
Let's solve #4005 first then. |
i don't think it's worth blocking optimizations with refactorings |
|
It's too easy to lose control over the codebase this way, we need to structure our changes appropriately as early as possible. |
agree. But at the same time the more usecases are created, the easier it will be to form libs i'll try my best to synthesize SDK packages asap |
5d595c6 to
ff70559
Compare
| } | ||
| if n != len(buf) { | ||
| return nil, fmt.Errorf("got wrong request length: expected %d, got %d", n, len(buf)) | ||
| return nil, newWrongRequestLengthError(len(buf), n) |
There was a problem hiding this comment.
one more usecase appears
There was a problem hiding this comment.
what this error means for a user btw? isnt it a panic?
There was a problem hiding this comment.
internal server error. Can be a panic. Should never happen anyway
ff70559 to
381aa09
Compare
| 1 + maxGetResponseChunkVarintLen // 1 for iprotobuf.TagBytes2 | ||
| getResponseChunkBufferLen = maxChunkOffsetInGetResponse + maxGetResponseChunkLen + maxResponseVerificationHeaderLen | ||
|
|
||
| modernRequestVerificationSignatureCount = 2 |
There was a problem hiding this comment.
make it api dependent? we will have nspcc-dev/neofs-api#406 soon, it will then be "the most modern"
There was a problem hiding this comment.
it is API dependent. To support new API feature, future change is inevitable
| MarshalStable([]byte) | ||
| } | ||
|
|
||
| func writeStablyMarshalledField(buf []byte, tag byte, ln int, fld stablyMarshalledFIeld) int { |
There was a problem hiding this comment.
can ln and fld merged into a single interface? likely every our struct will handle it ok
There was a problem hiding this comment.
length of embedded messages is always needed twice: to calc whole message len and to write field prefix. So, i dont like the idea to calc it twice
| } | ||
| if n != len(buf) { | ||
| return nil, fmt.Errorf("got wrong request length: expected %d, got %d", n, len(buf)) | ||
| return nil, newWrongRequestLengthError(len(buf), n) |
There was a problem hiding this comment.
what this error means for a user btw? isnt it a panic?
381aa09 to
4c3813e
Compare
roman-khimov
left a comment
There was a problem hiding this comment.
Needs to be shared with SDK code.
f701151 to
7a069cc
Compare
7a069cc to
53bf220
Compare
|
Linter. |
e6b27c0 to
03c0100
Compare
Server-side part of nspcc-dev/neofs-sdk-go@c4dda73. Additionally de-duplicates the request encoding for sending to multiple nodes. Refs #4005. Signed-off-by: Leonard Liubich <leonard@morphbits.io>
03c0100 to
60d9d35
Compare
|
|
||
| connAPIVersion := conn.APIVersion() | ||
| connAPIVersionMsg := conn.APIVersion() | ||
| connAPIVersion := version.New(connAPIVersionMsg.GetMajor(), connAPIVersionMsg.GetMinor()) |
There was a problem hiding this comment.
Previous API was made to optimize out version->protorefs conversion, now we have protorefs->version. Maybe we need to change the API then.
No description provided.