Support ranged GET, drop rangehash#3992
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3992 +/- ##
==========================================
+ Coverage 27.98% 28.09% +0.10%
==========================================
Files 681 679 -2
Lines 45626 45418 -208
==========================================
- Hits 12768 12758 -10
+ Misses 31667 31467 -200
- Partials 1191 1193 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Deprecated `Range`, `RangeHash`. Added range parameters to `Get`. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Remove deprecated `GetRangeHash` support across CLI and node. Keep only compatibility handling required by current API surface. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Allow using payload ranges with object GET. Keep object range as a separate operation for compatibility. Closes #3977. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
| // Header | ||
| w := tabwriter.NewWriter(cmd.OutOrStdout(), 1, 4, 4, ' ', 0) | ||
| fmt.Fprintln(w, "\tRangeHASH\tRange\tSearch\tDelete\tPut\tHead\tGet") | ||
| fmt.Fprintln(w, "\tRange\tSearch\tDelete\tPut\tHead\tGet") |
There was a problem hiding this comment.
Somewhat questionable, the bits are still there. Although now they're more like 'reserved' and don't print some of those.
| func (s *Server) GetRangeHash(_ context.Context, req *protoobject.GetRangeHashRequest) (*protoobject.GetRangeHashResponse, error) { | ||
| var err apistatus.BadRequest | ||
| err.SetMessage("GetRangeHash operation is no longer supported") | ||
| return s.makeStatusHashResponse(&err, req), nil |
There was a problem hiding this comment.
Take a look at searchV1 stub, it sends grpc-level error, not an API one. I think it's more appropriate.
| -h, --help help for get | ||
| --no-progress Do not show progress bar | ||
| --oid string Object ID. | ||
| --range string Range to take data from in the form offset:length |
There was a problem hiding this comment.
It should be possible to control header inclusion as well.
| if err != nil || exec.payloadOnly { | ||
| return nil, r, err | ||
| } | ||
| h, hErr := e.engine.Head(exec.address(), exec.isRaw()) |
There was a problem hiding this comment.
Suboptimal. But can be improved later.
There was a problem hiding this comment.
Pull request overview
This PR updates object retrieval to support ranged GET requests while removing deprecated range-hash support across the node, CLI, ACL, metrics, and client abstractions.
Changes:
- Adds GET range/payload-only plumbing through server, service, and CLI paths.
- Removes GetRangeHash/ObjectHash support, the
neofs-cli object hashcommand, and related ACL/metrics/client APIs. - Updates SDK dependency, generated CLI docs, and changelog entries.
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/services/object/server.go | Replaces GetRangeHash handling with unsupported status and adds ranged GET conversion/payload-only response handling. |
| pkg/services/object/server_test.go | Updates test stubs after removing range-hash interfaces. |
| pkg/services/object/put/service_test.go | Updates service client mock after removing ObjectHash. |
| pkg/services/object/get/util.go | Routes ranged reads through GET or legacy RANGE and adds payload-only options. |
| pkg/services/object/get/res.go | Removes range-hash result type. |
| pkg/services/object/get/prm.go | Adds GET range/payload-only parameters and removes range-hash parameters. |
| pkg/services/object/get/get.go | Wires GET range/payload-only options through object retrieval paths and removes range-hash service logic. |
| pkg/services/object/get/exec.go | Adds payload-only/legacy-range execution flags and removes range-hash forwarding state. |
| pkg/services/object/acl/v2/util.go | Removes range-hash request and verb compatibility handling. |
| pkg/services/object/acl/v2/util_test.go | Updates verb compatibility expectations after range-hash removal. |
| pkg/services/object/acl/v2/service.go | Removes HashRequestToInfo. |
| pkg/services/object/acl/v2/service_test.go | Removes range-hash ACL test coverage. |
| pkg/services/object/acl/eacl/v2/headers.go | Removes range-hash from EACL header-source handling. |
| pkg/network/cache/clients.go | Removes ObjectHash forwarding and annotates deprecated range API use. |
| pkg/metrics/object.go | Removes range-hash counters and histograms. |
| pkg/core/client/client.go | Removes ObjectHash from core client interface. |
| go.mod | Updates neofs-sdk-go version. |
| go.sum | Updates dependency checksums. |
| docs/cli-commands/neofs-cli_object.md | Removes object hash command from object command docs. |
| docs/cli-commands/neofs-cli_object_hash.md | Deletes object hash command documentation. |
| docs/cli-commands/neofs-cli_object_get.md | Documents new object get --range flag. |
| docs/cli-commands/neofs-cli_acl_extended_create.md | Removes getrangehash from ACL operation docs. |
| cmd/neofs-node/object.go | Removes range-hash service/client methods. |
| cmd/neofs-cli/modules/util/acl.go | Removes RangeHASH from BACL table output. |
| cmd/neofs-cli/modules/session/create_v2.go | Removes RANGEHASH verb parsing. |
| cmd/neofs-cli/modules/object/util.go | Removes ObjectHash session handling. |
| cmd/neofs-cli/modules/object/util_session_v2.go | Removes ObjectHash V2 session handling. |
| cmd/neofs-cli/modules/object/root.go | Removes object hash command registration. |
| cmd/neofs-cli/modules/object/range.go | Shares range flag constants and annotates legacy RANGE API use. |
| cmd/neofs-cli/modules/object/hash.go | Deletes object hash command implementation. |
| cmd/neofs-cli/modules/object/get.go | Adds --range support to object get. |
| cmd/neofs-cli/modules/acl/extended/create.go | Removes getrangehash from ACL creation help. |
| CHANGELOG.md | Documents ranged GET support, range-hash removal, and SDK update. |
Comments suppressed due to low confidence (2)
docs/cli-commands/neofs-cli_object_hash.md:1
- Deleting this command page leaves a broken reference in docs/cli.md, which still links to docs/cli-commands/neofs-cli_object_hash.md. Remove or update that index entry along with this deletion.
pkg/services/object/get/get.go:68 - Passing a GET range into the existing range execution path makes split-object assembly take the legacy RANGE branches, which intentionally do not write the parent header. For ranged GET with payloadOnly=false, split objects will stream only payload chunks and also skip response-header EACL rechecks that depend on the parent header.
opts := []execOption{
withPreSortedContainerNodes(nodeLists[:len(repRules)], repRules),
withPayloadRange(prm.rng),
withPayloadOnly(prm.payloadOnly),
withForwardGetRequestFunc(prm.forwardRequestFn),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if s.payloadOnly { | ||
| return nil | ||
| } |
| func (exec *execCtx) writeCollectedHeader() bool { | ||
| if exec.ctxRange() != nil { | ||
| if exec.payloadOnly { | ||
| return true |
| if exec.isRaw() { | ||
| opts.MarkRaw() | ||
| } | ||
| if exec.payloadOnly { |
| if body.GetPayloadOnly() { | ||
| p.MarkPayloadOnly() | ||
| } |
| return s.get(ctx, prm.commonPrm, withPreSortedContainerNodes(ecNodeLists, repRules), withPayloadRange(prm.rng), withPayloadOnly(prm.payloadOnly)).err | ||
| } | ||
|
|
||
| if prm.rng != nil { |
| opts := []execOption{withPayloadRange(prm.rng), withPayloadOnly(prm.payloadOnly)} | ||
| if prm.rng == nil && !prm.payloadOnly { | ||
| opts = append(opts, withLocalGetBuffer(prm.localGetBuffer, prm.submitLocalGetStreamFn)) | ||
| } | ||
| return s.get(ctx, prm.commonPrm, opts...).err // It handles locality internally. |
Closes #3977.