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

erose 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 aa80e88964 HDDS-9275. LegacyReplicationManager: Delete excess 
unhealthy with force=true (#5286)
aa80e88964 is described below

commit aa80e88964545667ed08b5299f1d776fac9ffa71
Author: Stephen O'Donnell <[email protected]>
AuthorDate: Wed Sep 13 18:55:26 2023 +0100

    HDDS-9275. LegacyReplicationManager: Delete excess unhealthy with 
force=true (#5286)
---
 .../hdds/scm/container/replication/LegacyReplicationManager.java | 2 +-
 .../scm/container/replication/TestLegacyReplicationManager.java  | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java
index e627ec4a3c..82b9d04b0d 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java
@@ -1188,7 +1188,7 @@ public class LegacyReplicationManager {
               "under replication handling for container {} with replicas {}.",
           container, replicas);
     } else {
-      sendDeleteCommand(container, replica.getDatanodeDetails(), false);
+      sendDeleteCommand(container, replica.getDatanodeDetails(), true);
     }
   }
 
diff --git 
a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java
 
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java
index 391e878db0..4afe59dc0d 100644
--- 
a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java
+++ 
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java
@@ -66,6 +66,7 @@ import org.apache.hadoop.hdds.utils.db.LongCodec;
 import 
org.apache.hadoop.ozone.common.statemachine.InvalidStateTransitionException;
 import org.apache.hadoop.ozone.container.common.SCMTestUtils;
 import org.apache.hadoop.ozone.protocol.commands.CommandForDatanode;
+import org.apache.hadoop.ozone.protocol.commands.DeleteContainerCommand;
 import org.apache.hadoop.ozone.protocol.commands.ReplicateContainerCommand;
 import org.apache.ozone.test.GenericTestUtils;
 import org.apache.ozone.test.TestClock;
@@ -1083,6 +1084,14 @@ public class TestLegacyReplicationManager {
       Assertions.assertTrue(datanodeCommandHandler.received(
           SCMCommandProto.Type.deleteContainerCommand,
           unhealthy.getDatanodeDetails()));
+
+      List<CommandForDatanode> commands = datanodeCommandHandler
+          .getReceivedCommands();
+      Assertions.assertEquals(1, commands.size());
+      DeleteContainerCommand deleteContainerCommand =
+          (DeleteContainerCommand) commands.get(0).getCommand();
+      Assertions.assertTrue(deleteContainerCommand.isForce());
+
       assertUnderReplicatedCount(1);
       // Update RM with the result of delete command
       containerStateManager.removeContainerReplica(


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

Reply via email to