[#2095] node: Fix collecting child objects

Stop child objects collection if the last returned object (the most "left"
object in the collected chain) starts exactly from the `GETRANGE`'s `from`
value.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-11-24 18:27:00 +03:00 committed by Anton Nikiforov
parent 350eecfa13
commit b413094704
3 changed files with 6 additions and 2 deletions

View file

@ -51,6 +51,8 @@ Changelog for NeoFS Node
- `neofs-cli container create ` check the sufficiency of the number of nodes in the selector for replicas (#2038)
- Data duplication during request forwarding (#2047)
- Tree service panic on `TreeMove` operation (#2140)
- Panic in `GETRANGE` with zero length (#2095)
- Spawning useless `GETRANGE` with zero length for a big object (#2101)
### Removed
- `-g` option from `neofs-cli control ...` and `neofs-cli container create` commands (#2089)

View file

@ -203,7 +203,9 @@ func (exec *execCtx) buildChainInReverse(prev oid.ID) ([]oid.ID, []objectSDK.Ran
// fill the chain end-to-start
for withPrev {
if exec.curOff < from {
// check that only for "range" requests,
// for `GET` it stops via the false `withPrev`
if seekRng != nil && exec.curOff <= from {
break
}

View file

@ -963,7 +963,7 @@ func TestGetRemoteSmall(t *testing.T) {
addr.SetObject(oidtest.ID())
srcObj := generateObject(addr, nil, nil)
srcObj.SetPayloadSize(10)
srcObj.SetPayloadSize(11)
ns, as := testNodeMatrix(t, []int{2})