Repository navigation
Improve GET/HEAD replica localization - #4232
Merged
Merged
Conversation
cthulhu-rider
force-pushed
the
get-rep-localization
branch
3 times, most recently
from
October 22, 2026 16:47
6fd1c09 to
ab15099
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4232 +/- ##
==========================================
+ Coverage 32.34% 32.37% +0.03%
==========================================
Files 673 673
Lines 41405 41430 +25
==========================================
+ Hits 13393 13414 +21
- Misses 28012 28016 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cthulhu-rider
marked this pull request as ready for review
October 22, 2026 17:59
cthulhu-rider
requested review from
End-rey,
carpawell and
roman-khimov
as code owners
October 22, 2026 17:59
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Retry handling can corrupt partially written responses, and failed split assembly can skip usable local metadata.
2 open issues
What changed in this PR
This PR changes GET/HEAD replica lookup to follow container placement order, prioritizing local storage when the node is a primary holder and otherwise deferring local reads.
Changes:
- Reorders replica traversal and adds a final local-storage fallback.
- Separates local and container result handling.
- Exports a node-set lookup helper, adjusts streaming-failure tests, and documents the behavior.
| File | Description |
|---|---|
pkg/services/object/get/local.go |
Returns whether local execution should stop traversal. |
pkg/services/object/get/get.go |
Separates request routing and result analysis. |
pkg/services/object/get/get_test.go |
Models local-node identity in streaming-failure tests. |
pkg/services/object/get/container.go |
Implements placement-aware local reads and fallback. |
internal/netmap/netmap.go |
Exports the single-node-set public-key lookup helper. |
CHANGELOG.md |
Documents the GET/HEAD lookup changes. |
Review effort: Balanced
roman-khimov
left a comment
Member
There was a problem hiding this comment.
Looks legit, but check Copilot comments.
cthulhu-rider
force-pushed
the
get-rep-localization
branch
from
October 26, 2026 11:26
ab15099 to
5de0c64
Compare
Was caused by a method call without changing the state.
Before:
```
2026-09-12T09:24:20.703+0300 debug get/get.go:239 operation finished with error {"component": "Object.Get service", "address": "3VkN6ekDbYnYrDAgmsj5c66GvDLaRVFZj4SBZhj6R8G2/3VkN6ekDbYnYrDAgmsj5c66GvDLaRVFZj4SBZhj6R8G2", "raw": false, "local": true, "with session": false, "with bearer": false, "request": "GET", "error": "status: code = 2049 message = object not found"}
2026-09-12T09:24:20.703+0300 debug get/container.go:11 return result directly {"component": "Object.Get service", "address": "3VkN6ekDbYnYrDAgmsj5c66GvDLaRVFZj4SBZhj6R8G2/3VkN6ekDbYnYrDAgmsj5c66GvDLaRVFZj4SBZhj6R8G2", "raw": false, "local": true, "with session": false, "with bearer": false, "request": "GET"}
2026-09-12T09:24:20.703+0300 debug get/get.go:239 operation finished with error {"component": "Object.Get service", "address": "3VkN6ekDbYnYrDAgmsj5c66GvDLaRVFZj4SBZhj6R8G2/3VkN6ekDbYnYrDAgmsj5c66GvDLaRVFZj4SBZhj6R8G2", "raw": false, "local": true, "with session": false, "with bearer": false, "request": "GET", "error": "status: code = 2049 message = object not found"}
```
Now there will be no repeat message.
Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Refactoring purpose. Signed-off-by: Leonard Liubich <leonard@morphbits.io>
The final goal is to not make local operation blindly but when handling sorted container node list. Also, a bit more code is usually more understandable than recursion. Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Previously, GET/HEAD server was always looked up for the object locally first, regardless of the placement policy. This introduced overhead in the case of optimal placement. The main motivation was to maintain object availability when its replica was moved to a reserve container node or if it became stuck outside the container. Since this is also a live case in a storage distributed system, this preserves local reading but as a fallback. In the context of performance on reading with a uniform load distribution across the entire cluster, an increase in RPS is not expected since the costs are negligible relative to actual DB/FS reading and RPC. However, with optimal placement (which is the target), the processing speed of a single request is guaranteed to increase, and the cost of a DB transaction (in particular, allocs) will disappear. Closes #3411. Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Signed-off-by: Leonard Liubich <leonard@morphbits.io>
They are always called in pairs. Signed-off-by: Leonard Liubich <leonard@morphbits.io>
cthulhu-rider
force-pushed
the
get-rep-localization
branch
from
October 26, 2026 11:27
5de0c64 to
e8346d8
Compare
roman-khimov
approved these changes
Oct 26, 2026
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
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.


i've had these changes for quite a while. I think it's time to improve this part