Skip to content

HDDS-15521. StreamBlockInputStream fails with TimeoutIOException without retry or failover#10479

Merged
sadanand48 merged 7 commits into
apache:masterfrom
sadanand48:HDDS-15521
Jul 7, 2026
Merged

HDDS-15521. StreamBlockInputStream fails with TimeoutIOException without retry or failover#10479
sadanand48 merged 7 commits into
apache:masterfrom
sadanand48:HDDS-15521

Conversation

@sadanand48

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

StreamBlockInputStream: Added a retry loop in dataAvailableToRead() that catches read failures (including TimeoutIOException) and calls handleExceptions() to release the stream, refresh pipeline/token, and reset requestedLength = position so reads resume from the current offset. On retry, failed datanodes are recorded in a per-stream failedStreamingDatanodes set and excluded from the next init.

XceiverClientGrpc: Extended initStreamRead() to accept an excluded-datanode set and skip those nodes when opening a new streaming stream, so retries target a different replica instead of rebinding to the same dead one. Added INFO logging to show which datanode each init selects.

What is the link to the Apache JIRA

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

How was this patch tested?

Mini-Ozone cluster test added

@adoroszlai adoroszlai 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 @sadanand48 for the patch. To reduce overhead of cluster startup, can you please rewrite test cases to share a single cluster?

@adoroszlai adoroszlai changed the title HDDS-15521. StreamBlockInputStream fails with TimeoutIOException without retry or datanode failover. HDDS-15521. StreamBlockInputStream fails with TimeoutIOException without retry or failover Jun 10, 2026

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

I didn't find enough context of this PR. Purely from I can tell so far, this PR try to address:

  1. The previous implementation do not catch and retry on TimeoutIOException
  2. The previous implementation do not retry for streamingReader.read(length, preRead) which also could throw IO exception.

If I understand the goal correctly, I would suggest:

  1. Just simply add
if (cause instance of TimeoutIOException || cause instanceof StorageContainerException || isConnectivityIssue(cause)) 
  1. Do a reasonable while loop retry for streamingReader.read(length, preRead)
  2. The retry count for initialize() and streamingReader.read(length, preRead) should be shared.

@sadanand48 sadanand48 requested a review from szetszwo June 19, 2026 06:59

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

@sadanand48 , thanks for working on this! Just have some minor comments inlined.

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

+1 the change looks good.

@sadanand48 sadanand48 marked this pull request as ready for review July 6, 2026 08:18
@sadanand48 sadanand48 merged commit 2076d7f into apache:master Jul 7, 2026
45 checks passed
@sadanand48

Copy link
Copy Markdown
Contributor Author

Thanks @szetszwo , @amaliujia, @adoroszlai for the reviews

errose28 added a commit to errose28/ozone that referenced this pull request Jul 7, 2026
* master: (519 commits)
  HDDS-14544. OM DB Insights: Duplicate API calls triggered when changing limit selector (apache#10677).
  HDDS-15587. [Recon] Show 0 for offline DN pending deletion instead of -1 (apache#10585).
  HDDS-15521. StreamBlockInputStream fails with TimeoutIOException without retry or failover. (apache#10479)
  HDDS-15170. Add mock-based unit tests for DataStream write path (apache#10230)
  HDDS-15552. Ratis events should not be published as metrics (apache#10523)
  HDDS-15746. Bump kerby to 2.1.2 (apache#10666)
  HDDS-15579. Replace SimpleSpanProcessor with BatchSpanProcessor (apache#10569)
  HDDS-15747. Address review comments for HDDS-15083 (apache#10669)
  HDDS-15732. Some ozone commands ignore OZONE_MODULE_ACCESS_ARGS (apache#10655)
  HDDS-15605. Fix flaky testContainerExclusionWithClosedContainerException (apache#10621)
  HDDS-11855. Fix flaky TestContainerBalancerDatanodeNodeLimit#checkIterationResultException (apache#10667)
  HDDS-15741. Bump awssdk to 2.46.17 (apache#10661)
  HDDS-10307. Speed up TestOzoneManagerHAWithStoppedNodes (apache#10658)
  HDDS-15651. Test case for DiskBalancer when markContainerForDelete fails (apache#10593)
  HDDS-15742. Bump nimbus-jose-jwt to 10.9.1 (apache#10662)
  HDDS-15719. Add check for allowed action usage in workflows (apache#10641)
  HDDS-15744. Bump javassist to 3.32.0-GA (apache#10665)
  HDDS-15737. Fix intermittent failure in balancerShouldOnlySelectConfiguredIncludeContainers (apache#10660)
  HDDS-15743. Bump gson to 2.14.0 (apache#10664)
  HDDS-11093. Fix intermittent failure in TestContainerBalancerDatanodeNodeLimit#testMetrics (apache#10659)
  ...

Conflicts:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerScanHelper.java
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.

4 participants