This is an automated email from the ASF dual-hosted git repository.

arafat2198 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 44cb3a59ee HDDS-11032. Decommissioned datanodes shows up again after 
removing in Recon Datanodes page. (#6833)
44cb3a59ee is described below

commit 44cb3a59ee29c296e0c77df742242fcba9a6d05e
Author: Devesh Kumar Singh <[email protected]>
AuthorDate: Wed Jun 19 20:35:01 2024 +0530

    HDDS-11032. Decommissioned datanodes shows up again after removing in Recon 
Datanodes page. (#6833)
---
 .../java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java     | 6 ++----
 .../java/org/apache/hadoop/ozone/recon/api/TestEndpoints.java    | 9 +++++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
index 478b92fa81..7f0efe97dd 100644
--- 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
+++ 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
@@ -280,8 +280,7 @@ public class NodeEndpoint {
     AtomicBoolean isContainerOrPipeLineOpen = new AtomicBoolean(false);
     try {
       nodeStatus = nodeManager.getNodeStatus(nodeByUuid);
-      boolean isNodeDecommissioned = nodeByUuid.getPersistedOpState() == 
NodeOperationalState.DECOMMISSIONED;
-      if (isNodeDecommissioned || nodeStatus.isDead()) {
+      if (nodeStatus.isDead()) {
         checkContainers(nodeByUuid, isContainerOrPipeLineOpen);
         if (isContainerOrPipeLineOpen.get()) {
           failedNodeErrorResponseMap.put(nodeByUuid.getUuidString(), "Open 
Containers/Pipelines");
@@ -298,8 +297,7 @@ public class NodeEndpoint {
       LOG.error("Node : {} not found", nodeByUuid);
       return false;
     }
-    failedNodeErrorResponseMap.put(nodeByUuid.getUuidString(), "DataNode 
should be in either DECOMMISSIONED " +
-        "operational state or DEAD node state.");
+    failedNodeErrorResponseMap.put(nodeByUuid.getUuidString(), "DataNode 
should be in DEAD node status.");
     return false;
   }
 
diff --git 
a/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestEndpoints.java
 
b/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestEndpoints.java
index e549a02e98..c3d2fd484a 100644
--- 
a/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestEndpoints.java
+++ 
b/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestEndpoints.java
@@ -1281,9 +1281,10 @@ public class TestEndpoints extends 
AbstractReconSqlDBTest {
         (RemoveDataNodesResponseWrapper) removedDNResponse.getEntity();
     DatanodesResponse errorDataNodes = 
removeDataNodesResponseWrapper.getDatanodesResponseMap().get("failedDatanodes");
     DatanodesResponse removedNodes = 
removeDataNodesResponseWrapper.getDatanodesResponseMap().get("removedDatanodes");
-    assertEquals(1, removedNodes.getTotalCount());
-    assertNull(errorDataNodes);
-    removedNodes.getDatanodes().forEach(datanodeMetadata -> {
+
+    assertEquals(1, errorDataNodes.getTotalCount());
+    assertNull(removedNodes);
+    errorDataNodes.getDatanodes().forEach(datanodeMetadata -> {
       assertEquals("host3.datanode", datanodeMetadata.getHostname());
     });
   }
@@ -1301,7 +1302,7 @@ public class TestEndpoints extends AbstractReconSqlDBTest 
{
     assertFalse(failedNodeErrorResponseMap.isEmpty());
     String nodeError = failedNodeErrorResponseMap.get(dnUUID);
     assertNotNull(nodeError);
-    assertEquals("DataNode should be in either DECOMMISSIONED operational 
state or DEAD node state.", nodeError);
+    assertEquals("DataNode should be in DEAD node status.", nodeError);
     assertEquals(Response.Status.OK.getStatusCode(), 
removedDNResponse.getStatus());
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to