swamirishi commented on code in PR #8561:
URL: https://github.com/apache/ozone/pull/8561#discussion_r2132269996
##########
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:
Even if it is equal we have not swapped here right? If 2 replica indices are
equal do we want to remove one replica only if the block files are same? Given
that this is a delete operation IMO we should be a bit careful
--
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]