yandrey321 opened a new pull request, #10842:
URL: https://github.com/apache/ozone/pull/10842

   ## What changes were proposed in this pull request?
   
   SCM refreshes a datanode's ports on re-registration (SCMNodeManager)
   
   1. When a datanode re-registers with a changed port set — e.g. it restarted 
with DataStream enabled and now advertises the RATIS_DATASTREAM port — SCM 
updates its stored NodeManager record instead of keeping the stale one. 
Previously a port-only change (same IP/hostname/version) was ignored, so SCM 
never learned the new port and every new pipeline stayed port-less.
   
   
   2. New PipelineManager.closeNonStreamablePipelines(): closes+deletes OPEN 
pipelines whose persisted node snapshot lacks a port the currently-registered 
nodes now expose BackgroundPipelineCreator then builds fresh, streaming-capable 
replacements. Runs automatically as part of the pipeline scrubber: 
scrubAndCloseNonStreamablePipelines() (scrubs, then closes non-streamable) is 
wired into the BackgroundPipelineScrubber. 
   
   
   Why close-and-recreate rather than heal in place: a pipeline created before 
DataStream persists a stale dataStreamAddress (the gRPC port) in its Raft group 
configuration. ServerState.setRaftConf() only re-adds peers to the gRPC RPC, 
not the datastream RPC, so the group can never stream in place — the group must 
be recreated.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-12991
   
   ## How was this patch tested?
   
   TestSCMNodeManager: testRegisterRefreshesPortsOnPortChange (ports changed → 
node record updated) and testRegisterKeepsPortsWhenUnchanged (unchanged → no 
update).
   TestPipelineManagerImpl: coverage for closeNonStreamablePipelines() — closes 
a portless OPEN pipeline once nodes expose the new port, and is a no-op when 
port sets already match.
   Integration — TestOzoneFileSystemDataStreamEnablement (MiniOzoneCluster, 
datanodes start with DataStream disabled, client with streaming enabled):
   
   testDataStreamFallbackAndPortRefresh: writes fall back gracefully while a 
pipeline is port-less; SCM refreshes the datanodes' ports on re-registration 
(validates piece 1).
   testCloseNonStreamablePipelineThenStream: a portless legacy pipeline 
survives a rolling restart + SCM restart; closeNonStreamablePipelines() retires 
it; a fresh streaming-capable pipeline forms and a streaming write succeeds 
end-to-end (validates piece 2).
   testBatchWritesAcrossStreamingEnablement: full lifecycle over a batch of 
files — several files written while disabled (all succeed via fallback), enable 
+ close legacy pipeline, then several more files that all stream over a 
RATIS_DATASTREAM-capable pipeline; asserts no write fails and the 
post-enablement writes take the streaming path.
   
   when part 1 (https://github.com/apache/ozone/pull/10828) is missing:
   
   ```
   mvn -pl hadoop-ozone/integration-test test \
     
-Dtest='TestOzoneFileSystemDataStreamEnablement#testBatchWritesAcrossStreamingEnablement'
 \
     -DskipShade -DskipRecon \
     -Ddevelocity.cache.local.enabled=false 
-Ddevelocity.cache.remote.enabled=false -Dscan=false
   
   Tests run: 1, Failures: 0, Errors: 1  <<< FAILURE!
   
   java.io.IOException: RATIS_DATASTREAM port is missing for datanode <dn>
     in pipeline <id>; datastream is disabled for this pipeline
       at 
org.apache.hadoop.ozone.client.io.KeyDataStreamOutput.handleWrite(KeyDataStreamOutput.java:212)
       ...
   Caused by: java.io.IOException: RATIS_DATASTREAM port is missing ...
       at 
org.apache.hadoop.hdds.scm.storage.BlockDataStreamOutput.setupStream(BlockDataStreamOutput.java:200)
       at 
org.apache.hadoop.hdds.scm.storage.BlockDataStreamOutput.<init>(BlockDataStreamOutput.java:173)
   
   ```


-- 
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]

Reply via email to