Skip to content

Support ranged GET, drop rangehash#3992

Open
End-rey wants to merge 3 commits into
masterfrom
ranged-get
Open

Support ranged GET, drop rangehash#3992
End-rey wants to merge 3 commits into
masterfrom
ranged-get

Conversation

@End-rey
Copy link
Copy Markdown
Contributor

@End-rey End-rey commented May 14, 2026

Closes #3977.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 34.00000% with 99 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.09%. Comparing base (d15615b) to head (26b400a).

Files with missing lines Patch % Lines
pkg/services/object/get/util.go 0.00% 38 Missing ⚠️
pkg/services/object/server.go 31.03% 17 Missing and 3 partials ⚠️
pkg/services/object/get/get.go 39.28% 15 Missing and 2 partials ⚠️
cmd/neofs-cli/modules/object/get.go 0.00% 12 Missing ⚠️
pkg/services/object/get/prm.go 0.00% 8 Missing ⚠️
cmd/neofs-cli/modules/util/acl.go 0.00% 3 Missing ⚠️
cmd/neofs-cli/modules/session/create_v2.go 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suboptimal. But can be improved later.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 hash command, 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.

Comment on lines +875 to +877
if s.payloadOnly {
return nil
}
Comment on lines 365 to 367
func (exec *execCtx) writeCollectedHeader() bool {
if exec.ctxRange() != nil {
if exec.payloadOnly {
return true
if exec.isRaw() {
opts.MarkRaw()
}
if exec.payloadOnly {
Comment on lines +1172 to +1174
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 {
Comment on lines +51 to +55
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.
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.

Support ranged GET, drop rangehash

3 participants