You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/10 18:20:48 UTC

[GitHub] [ozone] avijayanhwx commented on a change in pull request #2015: HDDS-4946. Do not wait one heartbeat to move newly registered datanodes that match SCM's MLV from HEALTHY_READONLY to HEALTHY

avijayanhwx commented on a change in pull request #2015:
URL: https://github.com/apache/ozone/pull/2015#discussion_r591761689



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java
##########
@@ -278,10 +292,21 @@ private void initializeStateMachines() {
    * @throws NodeAlreadyExistsException if the node is already present
    */
   public void addNode(DatanodeDetails datanodeDetails,
-                      LayoutVersionProto layoutInfo)
-      throws NodeAlreadyExistsException {
+      LayoutVersionProto layoutInfo) throws NodeAlreadyExistsException {
     NodeStatus newNodeStatus = newNodeStatus(datanodeDetails);
     nodeStateMap.addNode(datanodeDetails, newNodeStatus, layoutInfo);
+    UUID dnID = datanodeDetails.getUuid();
+    try {
+      updateLastKnownLayoutVersion(datanodeDetails, layoutInfo);

Review comment:
       Just an alternative suggestion, can we init state as HEALTHY for the Datanode, and move it to READONLY based on the alternative condition (layoutMismatch)? It is more likely for a new DN to be in a correct rather than a wrong layout version.

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java
##########
@@ -278,10 +292,21 @@ private void initializeStateMachines() {
    * @throws NodeAlreadyExistsException if the node is already present
    */
   public void addNode(DatanodeDetails datanodeDetails,
-                      LayoutVersionProto layoutInfo)
-      throws NodeAlreadyExistsException {
+      LayoutVersionProto layoutInfo) throws NodeAlreadyExistsException {
     NodeStatus newNodeStatus = newNodeStatus(datanodeDetails);
     nodeStateMap.addNode(datanodeDetails, newNodeStatus, layoutInfo);
+    UUID dnID = datanodeDetails.getUuid();
+    try {
+      updateLastKnownLayoutVersion(datanodeDetails, layoutInfo);

Review comment:
       Do we need to add a state == HEALTHY_READONLY check here?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org