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


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java:
##########
@@ -270,18 +270,15 @@ public void verifyAndFixupContainerData(ContainerData 
containerData)
    */
   private boolean resolveDuplicate(KeyValueContainer existing,
       KeyValueContainer toAdd) throws IOException {
-    if (existing.getContainerData().getReplicaIndex() != 0 ||
-        toAdd.getContainerData().getReplicaIndex() != 0) {
-      // This is an EC container. As EC Containers don't have a BSCID, we can't
-      // know which one has the most recent data. Additionally, it is possible
-      // for both copies to have a different replica index for the same
-      // container. Therefore we just let whatever one is loaded first win AND
-      // leave the other one on disk.
-      LOG.warn("Container {} is present at {} and at {}. Both are EC " +
-              "containers. Leaving both containers on disk.",
-          existing.getContainerData().getContainerID(),
-          existing.getContainerData().getContainerPath(),
-          toAdd.getContainerData().getContainerPath());
+    if (existing.getContainerData().getReplicaIndex() != 0 &&
+        existing.getContainerData().getReplicaIndex() != 
toAdd.getContainerData().getReplicaIndex()) {

Review Comment:
   Its being swapped based on State as down logic after if, for index same,
   - if existing is closed, given preference to this
   - else if new is closed, given preference to this
   - else preference is given to existing which is already loaded.



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