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 2020/06/04 03:42:14 UTC

[GitHub] [hadoop-ozone] dineshchitlangia commented on a change in pull request #1000: HDDS-3562. Datanodes should send ICR when a container replica deletion is successful.

dineshchitlangia commented on a change in pull request #1000:
URL: https://github.com/apache/hadoop-ozone/pull/1000#discussion_r434974495



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java
##########
@@ -225,14 +218,35 @@ private void updateContainerState(final DatanodeDetails datanode,
     }
   }
 
+  private void updateContainerReplica(final DatanodeDetails datanodeDetails,
+                                      final ContainerID containerId,
+                                      final ContainerReplicaProto replicaProto)
+      throws ContainerNotFoundException, ContainerReplicaNotFoundException {
+    final ContainerReplica replica = ContainerReplica.newBuilder()
+        .setContainerID(containerId)
+        .setContainerState(replicaProto.getState())
+        .setDatanodeDetails(datanodeDetails)
+        .setOriginNodeId(UUID.fromString(replicaProto.getOriginNodeId()))
+        .setSequenceId(replicaProto.getBlockCommitSequenceId())
+        .build();
+
+    if (replica.getState().equals(State.DELETED)) {
+      containerManager.removeContainerReplica(containerId, replica);
+    } else {
+      containerManager.updateContainerReplica(containerId, replica);
+    }
+  }
+
   /**
    * Returns true if the container replica is not marked as UNHEALTHY.
    *
    * @param replicaState State of the container replica.
    * @return true if unhealthy, false otherwise
    */
   private boolean isUnhealthy(final Supplier<State> replicaState) {

Review comment:
       NIT: Update javadocs




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org