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

node/object: Improve SEARCH and GET #2722

Merged
merged 3 commits into from
Apr 11, 2024
Merged

Conversation

cthulhu-rider
Copy link
Contributor

@cthulhu-rider cthulhu-rider commented Jan 17, 2024

No description provided.

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 28.79%. Comparing base (e500166) to head (7b06cee).
Report is 5 commits behind head on master.

❗ Current head 7b06cee differs from pull request most recent head 2521e89. Consider uploading reports for the commit 2521e89 to get more accurate results

Files Patch % Lines
pkg/services/object/search/container.go 57.14% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2722      +/-   ##
==========================================
+ Coverage   22.20%   28.79%   +6.58%     
==========================================
  Files         793      415     -378     
  Lines       47442    32385   -15057     
==========================================
- Hits        10533     9324    -1209     
+ Misses      36004    22225   -13779     
+ Partials      905      836      -69     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cthulhu-rider cthulhu-rider force-pushed the bugfix/object-search-server branch from a862cb4 to 7b06cee Compare January 17, 2024 14:14
@cthulhu-rider cthulhu-rider changed the title ObjectService.Search server enhancements Optimize storage policy processing Jan 22, 2024
@cthulhu-rider
Copy link
Contributor Author

prelim refactor has been done to:

  • decrease number of utility components: they did not justify themselves, over time the code remained more complex, and the proposed flexibility was not needed
  • make subsequent optimizations under the hood without affecting the code architecture

Previously, `ObjectService.Search` RPC server could write empty
intermediate messages to the response stream. This did not break
anything, but it resulted in a waste of cluster resources without any
benefit. The case occurred due to the fact that the server sends at
least one response message based on the search result on each of the
container nodes, and empty results were not excluded.

From now, if nothing is found on a single node, the server does not
write a message to the stream.

Signed-off-by: Leonard Lyubich <[email protected]>
Previously, `ObjectService.Search` RPC server could send a request to a
remote container node more than once in the context of processing a
single client request. On the one hand, this makes no sense, since the
state of the remote node is assumed to be unchanged in the context of a
single request. On the other hand, the resource costs for a repeated
request are prohibitively high - signatures, network, local storage.

In practice, repetitions occurred in two cases:
 - storage policy specifics, e.g. with several replica (`REP`) rules
 - when switching processing to previous epochs: some nodes could
   "remain" in the container

This is solved by storing the processed nodes in memory. Incurs much
lower costs than repeated requests.

Signed-off-by: Leonard Lyubich <[email protected]>
@cthulhu-rider cthulhu-rider force-pushed the bugfix/object-search-server branch from ba6bcd5 to dcc7bd3 Compare April 10, 2024 07:40
@cthulhu-rider cthulhu-rider changed the title Optimize storage policy processing node/object: Improve SEARCH and GET Apr 10, 2024
Same motivation and changes as in 67ababa.

Signed-off-by: Leonard Lyubich <[email protected]>
@cthulhu-rider cthulhu-rider force-pushed the bugfix/object-search-server branch from dcc7bd3 to 2521e89 Compare April 10, 2024 07:57
@cthulhu-rider
Copy link
Contributor Author

decided to leave standalone improvements here and continue policy optimizations in next PR

@cthulhu-rider cthulhu-rider marked this pull request as ready for review April 10, 2024 08:02
@cthulhu-rider cthulhu-rider marked this pull request as draft April 10, 2024 08:49
@cthulhu-rider cthulhu-rider marked this pull request as ready for review April 10, 2024 09:39
@cthulhu-rider cthulhu-rider merged commit f65eeb3 into master Apr 11, 2024
13 of 14 checks passed
@cthulhu-rider cthulhu-rider deleted the bugfix/object-search-server branch April 11, 2024 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants