Skip to content

HDDS-15886. Use block length from datanode for under-construction block in StreamBlockInputStream - #11551

Draft
chungen0126 wants to merge 2 commits into
apache:masterfrom
chungen0126:chungen0126/HDDS-15886
Draft

chungen0126 wants to merge 2 commits into
apache:masterfrom
chungen0126:chungen0126/HDDS-15886

Conversation

@chungen0126

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

With ozone.client.stream.read.block enabled, a reader can't read all hsync'ed data of a file that is still being written. It hits EOF at the block length OM last recorded, which can be stale for the last block because hsyncKey only updates OM when the last block changes. BlockInputStream handles this by getting the real length from the datanode for an under-construction block; StreamBlockInputStream did not.

This PR passes the under-construction flag to StreamBlockInputStream. Before the first read, the stream sends one GetBlock to get the real length, using the existing retry handling. Other blocks send no extra RPC.

What is the link to the Apache JIRA

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

How was this patch tested?

  • New unit tests in TestStreamBlockInputStream.
  • TestOzoneContractFSO with streamReadBlock enabled: testSyncable fails before this change and passes after. It also passes with streamReadBlock disabled.

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

chungen0126 and others added 2 commits October 15, 2026 09:18
…ck in StreamBlockInputStream

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant