-
Notifications
You must be signed in to change notification settings - Fork 45
PUT server code improvements #3506
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
Draft
cthulhu-rider
wants to merge
27
commits into
master
Choose a base branch
from
ec-put-parallel
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use one instruction to calculate the flag. Also, do it per-object and do not store in the struct field. In addition, evaluate only for non-local requests. Signed-off-by: Leonard Lyubich <[email protected]>
Will be useful for EC policies in #3420. Signed-off-by: Leonard Lyubich <[email protected]>
So it can be reused. Signed-off-by: Leonard Lyubich <[email protected]>
This extends PUT server logic to comply with EC policies - independently or together with REP ones. This logic will remain inactive until it becomes possible to create containers with EC policies. This works for small objects only: encoding and distribution will be the same for big objects, but SNs will deny them without proper adaptation. Closes #3419. Refs #3420. Signed-off-by: Leonard Lyubich <[email protected]>
On the one hand, unconditional locking seems safer. From the other one, such code could create a false impression that the set of signatures may change after being sent to the contract. However: 1. this cannot happen; 2. even if it did, it would be wrong behavior. Since lock is acquired for writing only now, `sync.RWMutex` is replaced with faster `sync.Mutex`. Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
The parameter is one and required. Signed-off-by: Leonard Lyubich <[email protected]>
So that it is clear what must be specified and what is not. Signed-off-by: Leonard Lyubich <[email protected]>
Method did not check pointer for nil. Anyway, it is never nil. Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
It's clearer this way. Signed-off-by: Leonard Lyubich <[email protected]>
There is only one result. Signed-off-by: Leonard Lyubich <[email protected]>
Previously, it was checked by internal processor and had disadvantages described below. PUT handler detected a flow violation too late. For example, on repeated heading message receipt, the server done resource-intensive checks of the request signatures and body. Although flow check is extremely lightweight. The internal processor is also used for internal SN needs. It always uses it correctly, therefore checks are unnecessary. Now stream control is done instantly upon receipt of the next message. Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
`internal.Target` is an implementation detail that should not be included in server responses. Although currently server does not attach them to the response status, after #2744 it would have shown up. Signed-off-by: Leonard Lyubich <[email protected]>
In addition to having fewer methods, it is now impossible to pass chunk or close before the header. This reduces the likelihood of dev mistakes. Signed-off-by: Leonard Lyubich <[email protected]>
The field was used in single method, so was no sense in being a field. Signed-off-by: Leonard Lyubich <[email protected]>
More accepted approach in Go. Signed-off-by: Leonard Lyubich <[email protected]>
It became a redundant wrapper around `Service` type. Signed-off-by: Leonard Lyubich <[email protected]>
The original intention was to remove the nil check and chaining within the setters themselves. However, replacing them removes even more code. Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
Use `Service` field instead. Although not all fields may be needed, this is a simpler approach anyway. Signed-off-by: Leonard Lyubich <[email protected]>
To make it clearer what it locks. Signed-off-by: Leonard Lyubich <[email protected]>
There are a lot of fields, so at least the state variables are separated. Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
No longer need to have private `PutInitOptions` fields with this anymore. Signed-off-by: Leonard Lyubich <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3506 +/- ##
==========================================
+ Coverage 23.46% 23.79% +0.32%
==========================================
Files 669 674 +5
Lines 50243 50448 +205
==========================================
+ Hits 11788 12002 +214
+ Misses 37535 37511 -24
- Partials 920 935 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
df36b3a
to
00af94f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
continues #3457. I'd like to have this before #3504