sumitagrawl commented on code in PR #9719:
URL: https://github.com/apache/ozone/pull/9719#discussion_r2821111811


##########
hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto:
##########
@@ -202,6 +206,8 @@ enum Type {
   GetContainerBalancerStatusInfo = 44;
   ReconcileContainer = 45;
   GetDeletedBlocksTransactionSummary = 46;
+  AcknowledgeMissingContainer = 47;

Review Comment:
   Can have single api to handle setting / reset of the ACK_MISSING, and can 
provide another api to list only ACK_MISSING containers (may be separate PR).



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/AcknowledgedMissingContainerHandler.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hdds.scm.container.replication.health;
+
+import org.apache.hadoop.hdds.scm.container.ContainerID;
+import org.apache.hadoop.hdds.scm.container.ContainerInfo;
+import org.apache.hadoop.hdds.scm.container.replication.ContainerCheckRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class used in Replication Manager to skip containers that have been
+ * acknowledged as missing. These containers will still be marked as
+ * MISSING in the health state but will not trigger replication.
+ */
+public class AcknowledgedMissingContainerHandler extends AbstractCheck {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(AcknowledgedMissingContainerHandler.class);
+

Review Comment:
   no need specific handling, when container is picked for handling report, if 
ACK_MISSING, just ignore in processing report at caller itself



##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerInfo.java:
##########
@@ -87,6 +87,7 @@ public final class ContainerInfo implements 
Comparable<ContainerInfo> {
   private long sequenceId;
   // Health state of the container (determined by ReplicationManager)
   private ContainerHealthState healthState;
+  private boolean ackMissing;

Review Comment:
   Instead of having new boolean, new healthState can be defined as 
ACK_MISSING, and same if set need not be tracked / updated in report handling



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerStateManagerImpl.java:
##########
@@ -551,6 +551,23 @@ public void reinitialize(
     }
   }
 
+  @Override
+  public void updateContainerInfo(HddsProtos.ContainerInfoProto 
updatedInfoProto)
+      throws IOException {
+    ContainerInfo updatedInfo = ContainerInfo.fromProtobuf(updatedInfoProto);
+    ContainerID containerID = updatedInfo.containerID();
+    
+    try (AutoCloseableLock ignored = writeLock(containerID)) {
+      final ContainerInfo currentInfo = 
containers.getContainerInfo(containerID);
+      if (currentInfo == null) {
+        throw new ContainerNotFoundException(containerID);
+      }
+      currentInfo.setAckMissing(updatedInfo.isAckMissing());

Review Comment:
   persist of ACK_MISSING only should happen, other state, no need persist as 
its dynamic, can have comment for same.



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

Reply via email to