swamirishi commented on code in PR #8887: URL: https://github.com/apache/ozone/pull/8887#discussion_r2297640975
########## hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java: ########## @@ -261,6 +268,30 @@ public void verifyAndFixupContainerData(ContainerData containerData) } } + private boolean isMatchedLastLoadedECContainer( + KeyValueContainer kvContainer, WitnessedContainerMetadataStore containerMetadataStore) throws IOException { + if (null != containerMetadataStore && kvContainer.getContainerData().getReplicaIndex() != 0) { + ContainerCreateInfo containerCreateInfo = containerMetadataStore.getContainerCreateInfoTable() + .get(ContainerID.valueOf(kvContainer.getContainerData().getContainerID())); + // check for EC container replica index matching if db entry is present for container as last loaded, + // and ignore loading container if not matched. + // Ignore matching container replica index -1 in db as no previous replica index + if (null != containerCreateInfo + && containerCreateInfo.getReplicaIndex() != ContainerCreateInfo.INVALID_REPLICA_INDEX + && containerCreateInfo.getReplicaIndex() != kvContainer.getContainerData().getReplicaIndex()) { + LOG.info("EC Container {} with replica index {} present at path {} is not matched with DB replica index {}," + Review Comment: nit: Given that we are not deleting the container data anymore the log should just say not loading the container data. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org