ChenSammi commented on code in PR #10105:
URL: https://github.com/apache/ozone/pull/10105#discussion_r3145087485
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImpl.java:
##########
@@ -170,11 +170,36 @@ private DeletedBlocksTransaction constructNewTransaction(
if (replicatedSize >= 0) {
builder.setTotalBlockReplicatedSize(replicatedSize);
builder.setTotalBlockSize(blocks.stream().mapToLong(DeletedBlock::getSize).sum());
+ setRequiredNodesIfKnown(builder, containerID);
}
}
return builder.build();
}
+ /**
+ * Sets the {@code requiredNodes} field of the transaction so that each DN
+ * can compute its per-replica pending-deletion contribution as
+ * {@code totalBlockReplicatedSize / requiredNodes}.
+ *
+ * <p>If the container is not found (race with container deletion) the field
+ * is left unset; DNs fall back to {@code totalBlockSize} in that case.
+ */
+ private void setRequiredNodesIfKnown(DeletedBlocksTransaction.Builder
builder,
Review Comment:
How about do the sizePerReplica calculation in OM when replicatedSize is
calculated?
--
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]