szetszwo commented on code in PR #10842:
URL: https://github.com/apache/ozone/pull/10842#discussion_r3676056055
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManager.java:
##########
@@ -117,6 +117,14 @@ void addContainerToPipeline(PipelineID pipelineID,
ContainerID containerID)
void closeStalePipelines(DatanodeDetails datanodeDetails);
+ /**
+ * Close OPEN pipelines whose datanodes now expose a port name that the
+ * pipeline's stored node snapshot lacks, so fresh pipelines advertising the
+ * new port are created in their place. A pipeline's cannot pick up
+ * a newly advertised port in place, so it must be recreated.
+ */
+ void closePipelinesExposingNewPorts();
Review Comment:
Since this method only called internally in PipelineManagerImpl, let's keep
it private/package private and don't add it to the interface.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -487,6 +492,22 @@ public RegisteredCommand register(
.build();
}
+ /**
+ * Whether the datanode's exposed ports changed between two registrations.
+ * Compared as a set of name=value entries, since
+ * {@link DatanodeDetails.Port#equals} ignores the port value.
+ */
+ private static boolean portsChanged(DatanodeDetails oldNode,
Review Comment:
portsChanged and exposesNewPorts are two very similar methods. Let's keep
only one and consistently using it.
- Since portsChanged is more general. Let's keep it, move it to
DatanodeDetails and make it non-static.
- Remove exposesNewPorts since it is harder to use (non-commutative:
a.exposesNewPorts(b) and b.exposesNewPorts(a) could be different.)
--
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]