smengcl commented on code in PR #11557:
URL: https://github.com/apache/ozone/pull/11557#discussion_r4300094304
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ECUnderReplicationHandler.java:
##########
@@ -519,12 +521,20 @@ private int processDecommissioningIndexes(
new ArrayList<>(decomIndexes), sources, availableSourceNodes,
excludedNodes, usedNodes);
if (commandsSent > 0) {
+ metrics.incrEcReconstructionDecommissionTriggeredTotal();
return commandsSent;
}
+ metrics.incrEcDecommissionReconstructionFallbackNoOpTotal();
} catch (CommandTargetOverloadedException e) {
LOG.debug("Reconstruction throttled for decommissioning container "
+ "{}, using 1-1 replication.",
container.containerID(), e);
+
metrics.incrEcDecommissionReconstructionFallbackTargetOverloadedTotal();
+ } catch (InsufficientDatanodesException e) {
Review Comment:
InsufficientDatanodesException does not always mean that no reconstruction
command was sent. `processReconstruction()` sends a partial command and adds
pending ADD operations before throwing when `targetCount !=
expectedTargetCount`. With two decommissioning indexes and one available
target, this catch falls through to the 1-to-1 path and schedules another
replication for the index already covered by the reconstruction command.
Pls rethrow when a pending reconstruction ADD was created so the outer
handler requeues the partial result. Only count the no-op fallback when no
command was sent.
```diff
@@
} catch (InsufficientDatanodesException e) {
+ if (replicaCount.decommissioningOnlyIndexes(true).size()
+ < decomIndexes.size()) {
+ throw e;
+ }
LOG.debug("Reconstruction could not place targets for
decommissioning "
```
--
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]