yandrey321 opened a new pull request, #10828: URL: https://github.com/apache/ozone/pull/10828
## What changes were proposed in this pull request? HDDS-12991 Gracefully enable Ratis DataStream on a running cluster with pre-existing pipelines When Ratis DataStream is turned on for an already-running cluster, datanodes and pipelines created before the feature was enabled do not expose the RATIS_DATASTREAM port. A streaming-enabled client attempting to write to such a pipeline previously failed. This change makes that transition graceful — a streaming client transparently falls back to the non-streaming write path when the target pipeline can't stream: - BlockDataStreamOutput now throws a typed StreamNotSupportedException (new) instead of a generic IOException when a pipeline node lacks the RATIS_DATASTREAM port. - KeyDataStreamOutput surfaces this exception as-is (after closing the stream) so callers can distinguish "pipeline can't stream" from other I/O errors. - SelectorOutputStream gains an optional fallback selector: on the first flush, if the selected streaming output throws StreamNotSupportedException, it closes that output and replays the buffered prefix + payload to a non-streaming fallback stream. Once the first flush succeeds, the buffer is released and subsequent writes go straight to the selected stream (no behavior change when streaming works or when no fallback is configured). -BasicOzoneFileSystem / BasicRootedOzoneFileSystem wire the non-streaming path (createFSOutputStream(adapter.createFile(...))) as that fallback. Co-authored with Cloude Code ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-12991 https://issues.apache.org/jira/browse/HDDS-15799 https://issues.apache.org/jira/browse/HDDS-8687 ## How was this patch tested? ### Unit tests TestSelectorOutputStream (12 tests) — covers the fallback-on-first-flush path, replay of buffered data, failing-close during fallback, and the no-fallback-configured (propagate) path. TestSCMNodeManager — testRegisterRefreshesPortsOnPortChange (ports changed → node record updated) and testRegisterKeepsPortsWhenUnchanged (ports unchanged → no update). ### Integration test TestOzoneFileSystemWithStreamingDisabledDatanode — brings up a cluster with RATIS_DATASTREAM disabled on the datanodes but streaming enabled on the client (auto-threshold 1B), then asserts a write falls back to non-streaming and round-trips correctly over both o3fs and ofs. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
