sodonnel commented on code in PR #7402:
URL: https://github.com/apache/ozone/pull/7402#discussion_r1838421679


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java:
##########
@@ -85,22 +98,41 @@ public void setRecoveringTimeout(long recoveringTimeout) {
     this.recoveringTimeout = recoveringTimeout;
   }
 
+  public boolean addContainer(Container<?> container) throws 
StorageContainerException {
+    return addContainer(container, false);
+  }
+
   /**
    * Add Container to container map.
    * @param container container to be added
    * @return If container is added to containerMap returns true, otherwise
    * false
    */
-  public boolean addContainer(Container<?> container) throws
+  public boolean addContainer(Container<?> container, boolean 
overwriteMissingContainers) throws
       StorageContainerException {
     Preconditions.checkNotNull(container, "container cannot be null");
 
     long containerId = container.getContainerData().getContainerID();
+    State containerState = container.getContainerData().getState();
+    if (!overwriteMissingContainers && 
missingContainerSet.contains(containerId)) {

Review Comment:
   I don't understand why we cannot just check if the container is in the 
ContainerIDTable? Why do we need to use this missingContainerSet instead?
   
   I traced the creation of the missing set to a ratis snapshot (I know nothing 
about it) and a diff against the containers found in memory. What about EC 
containers? Do they all become part of this missing set?
   
   Prior to this change, the missingSet doesn't seem to be used for anything 
inside this class, but not it is used for these checks. What was missingSet 
used for before?
   
   I would have thought the ContainerID table starts initially empty after this 
change is committed. On first start, it gets populated with all containers in 
the ContainerSet (scanned from disk). After initial startup, or later startups, 
it can also have all containers added, but they should already all be there. 
Then we can just track previously created in the containerID table?



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