Skip to content

HDDS-12918. OM support byte range GET#10166

Closed
ivandika3 wants to merge 11 commits into
apache:masterfrom
ivandika3:HDDS-12918
Closed

HDDS-12918. OM support byte range GET#10166
ivandika3 wants to merge 11 commits into
apache:masterfrom
ivandika3:HDDS-12918

Conversation

@ivandika3

@ivandika3 ivandika3 commented May 1, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Similar to HDDS-11699, we can move the byte range GET filter from S3G to the OM so that the network and serialization cost can be reduced for objects with a lot of blocks.

Applications like JuiceFS on S3 uses quite a bit of byte range fetch.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-12918

How was this patch tested?

UT, IT.

@ivandika3 ivandika3 self-assigned this May 1, 2026
@ivandika3 ivandika3 changed the title HDDS-12918. HDDS-12918. OM support byte range GET May 1, 2026
@peterxcli
peterxcli self-requested a review May 1, 2026 13:08
@ivandika3
ivandika3 marked this pull request as ready for review May 2, 2026 12:56
@ivandika3
ivandika3 requested a review from Gargi-jais11 May 2, 2026 13:20

@Gargi-jais11 Gargi-jais11 left a comment

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.

Thanks @ivandika3 for the patch.
Please find inlined review comments

@peterxcli peterxcli 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.

Thanks @ivandika3 for the patch, I'm looking if we could remove the setByteRangeStartOffset, calculate the start offset at s3g side, it take the first block of block list and use the range info from header to calculate the offset, then use the result as input stream's seek offset

* @return {@link OzoneKey}
* @throws IOException
*/
default OzoneKeyDetails getS3KeyDetails(String bucketName, String keyName,

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.

why there is a implementation?

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.

this should sit in ClientProtocolStub.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This exists as part of a client-side compatibility for other clients that implements ClientProtocol, but it's not RpcClient. If getS3KeyDetails API is called on older implementation (that does not have a concrete implementation of getS3KeyDetails) without, the API call will not work since it does not have any concrete implementation.

However, I think we can safely assume that only RpcClient implements ClientProtocol as Ozone is not a library per se (in contrast to Hadoop FileSystem interface which is extended depending on different backing store).

Comment on lines +1105 to +1108
// Byte range requested by S3 GET. OM uses it to return only the
// key locations needed to satisfy the read.
optional uint64 byteRangeStart = 25;
optional uint64 byteRangeEnd = 26;

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.

How about introducing a common msg, I remember few DN-SCM pb messages have range concept, maybe we could reuse theirs?

message ByteRange {
  // Inclusive start and end offsets: [start, end].
  optional uint64 start = 1;
  optional uint64 end   = 2;
}

message KeyArgs {
  // ...
  optional ByteRange byteRange = 25;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated.

keyArgs.getForceUpdateContainerCacheFromSCM())
.setMultipartUploadPartNumber(keyArgs.getMultipartNumber())
.build();
if (keyArgs.hasByteRangeStart() && keyArgs.hasByteRangeEnd()) {

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.

could become

Suggested change
if (keyArgs.hasByteRangeStart() && keyArgs.hasByteRangeEnd()) {
if (keyArgs.hasByteRange()) {

if we introduce new range message.
https://github.com/apache/ozone/pull/10166/changes#r3180692841

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Comment on lines +455 to +457
OzoneKeyDetails rangedKeyDetails = getClientProtocol()
.getS3KeyDetails(bucketName, keyPath, partNumber, startOffset,
endOffset);

@ivandika3 ivandika3 May 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a correctness issue, we should not call getS3KeyDetails multiple times within a single S3 call since the latter getS3KeyDetails might not return the same key as the first (i.e. there is a key overwrite in between).

The reason of the current multiple getS3KeyDetails is that the first getS3KeyDetails need to be used to get the key length for range header validation. Therefore, we need to push this range validation to OM.

Addressing this.

@ivandika3
ivandika3 marked this pull request as draft May 7, 2026 02:47
@github-actions

Copy link
Copy Markdown

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@github-actions github-actions Bot added the stale label May 31, 2026
@ivandika3 ivandika3 removed the stale label Jun 2, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

@github-actions github-actions Bot added the stale label Jul 3, 2026
@github-actions

Copy link
Copy Markdown

Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it.

@github-actions github-actions Bot closed this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants