adoroszlai opened a new pull request #2947:
URL: https://github.com/apache/ozone/pull/2947


   ## What changes were proposed in this pull request?
   
   Mini cluster (used for integration tests) needs to avoid port conflicts that 
arise due to running several instances of the same service on the same host.  
The problem affects HA clusters the most, since members of the OM or SCM 
service all need to be configured before starting any of them, hence random 
port assignment cannot be deferred to start time.  Furthermore, there are tests 
where one or more nodes are initially inactive and only later added to the 
service (bootstrap).  If ports are assigned to these, but the server is not 
started, other components (e.g. datanodes) may reuse the same port.
   
   This change introduces a way to reserve ports by keeping the sockets (bound 
to random ports) open until the real server is ready to be started.  At that 
time the sockets are released, leaving only a short window for port conflict.
   
   There are some RPC servers in both OM and SCM that are started as soon as 
they are constructed, not as part of `start()`.  We need to use a different set 
of ports for these, so that we can release them sooner.
   
   The patch also simplifies some constructor signatures by passing 
`OMHAService` and `SCMHAService` directly, instead of separate active/inactive 
lists, service ID and now ports.  This also makes the separate 
`MiniOzoneOMHAClusterImpl` class (in which only OM is HA, not SCM) unnecessary.
   
   https://issues.apache.org/jira/browse/HDDS-6114
   
   ## How was this patch tested?
   
   Repeated 20x some tests that have been observed to fail with the RocksDB 
init error:
   https://github.com/adoroszlai/hadoop-ozone/runs/4641359216
   https://github.com/adoroszlai/hadoop-ozone/runs/4640488288
   
   Regular CI:
   https://github.com/adoroszlai/hadoop-ozone/actions/runs/1626311916


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