Skip to content

object/GET: allow to fetch exact EC part in GET request#393

Open
carpawell wants to merge 1 commit into
masterfrom
feat/EC-GET-with-no-part-index
Open

object/GET: allow to fetch exact EC part in GET request#393
carpawell wants to merge 1 commit into
masterfrom
feat/EC-GET-with-no-part-index

Conversation

@carpawell

Copy link
Copy Markdown
Member

Closes #348.

Closes #348.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
@carpawell carpawell force-pushed the feat/EC-GET-with-no-part-index branch from 9c0e665 to 8fe6ee4 Compare June 22, 2026 04:37
Comment thread object/service.proto
// `PlacementPolicy.ec_rules` list.
// If `__NEOFS__EC_PART_IDX` is also included in X-headers, node returns
// corresponding part, otherwise nodes returns any part for the rule
// described above it has (if more that one part were found, the order

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i find it dangerous when netmap is changing, and there could be policer's object changes. the same is about any form of GETRANGE

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.

Multipart can be solved by returning "appropriate" (as per current placement) or lower index (if there is no appropriate) part.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Multipart can be solved by returning "appropriate"

from which side? client or server? what if they are different? if we believe that netmap is ok (not changing right now) why is this optimisation needed at all?

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.

Only server (the one processing the request) can decide here.

Comment thread object/service.proto
// `__NEOFS__EC_PART_IDX` by object attribute format. Rule index MUST NOT
// exceed container's `PlacementPolicy.ec_rules` list. Part index MUST NOT
// exceed total part number in the indexed rule.
// - `meta_header.x_headers` includes `__NEOFS__EC_RULE_IDX` by object

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not do the same for GetRange?

@carpawell carpawell Jun 22, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

as i stated in the thread above: i am afraid that we will have many problems with undefined requests (no part index x-headers) returning objects if no header is received in the same request (any GETRANGE/GET with range and payload_only) is not safe cause it is impossible to know what exact object was handled

Comment thread object/service.proto
// `PlacementPolicy.ec_rules` list.
// If `__NEOFS__EC_PART_IDX` is also included in X-headers, node returns
// corresponding part, otherwise nodes returns any part for the rule
// described above it has (if more that one part were found, the order

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

order is undefined

since parts are streamed to the client one-by-one, i think it is worth guaranteeing direct order. Is there any reason not to do so?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

do you suggest returning every part in the same GET request in case of any conflicts?

@roman-khimov roman-khimov left a comment

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.

The spec is rather simple, however this raises questions over forwarding optimizations, these require strict ordering and we can end up with more simultaneous connections.

Comment thread object/service.proto
// `PlacementPolicy.ec_rules` list.
// If `__NEOFS__EC_PART_IDX` is also included in X-headers, node returns
// corresponding part, otherwise nodes returns any part for the rule
// described above it has (if more that one part were found, the order

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.

Multipart can be solved by returning "appropriate" (as per current placement) or lower index (if there is no appropriate) part.

Comment thread object/service.proto
// described above it has (if more that one part were found, the order
// is undefined). Part index MUST NOT exceed total part number in the
// indexed rule. `__NEOFS__EC_PART_IDX` MUST NOT be omitted with
// non-nil `body.range` or `body.payload_only` field set to `true`.

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.

Range does require idx for sure, but payload only can be solved with x header returned from node.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i vote for returning this header always then

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.

An option too.

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.

Allow to get EC chunk by rule idx only

3 participants