smengcl commented on code in PR #11399:
URL: https://github.com/apache/ozone/pull/11399#discussion_r4276577336
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java:
##########
@@ -532,6 +550,7 @@ public void sendThrottledReplicationCommand(ContainerInfo
containerInfo,
ReplicateContainerCommand cmd =
ReplicateContainerCommand.toTarget(containerID, target);
cmd.setReplicaIndex(replicaIndex);
+ cmd.setTargetVolumeStorageType(targetVolumeStorageType);
Review Comment:
Pending-replica accounting ignores the target storage type.
The command now carries targetVolumeStorageType, but
adjustPendingOpsAndMetrics still calls getStorageType(containerInfo) for
scheduleAddReplica. When a replica actual volume type differs from the
container policy tier, the pending tracker reserves capacity on the wrong tier.
It can then admit another allocation on the real target tier or reject a valid
one. Use the command target type, with the old container value only as the
compatibility fallback.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManagerUtil.java:
##########
@@ -120,6 +122,37 @@ public static List<DatanodeDetails>
getTargetDatanodes(PlacementPolicy policy,
SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE);
}
+ /** Selects targets using the storage type of each replica, including
containers with mixed replica types. */
+ public static Map<ContainerReplica, DatanodeDetails>
getTargetDatanodesForReplicas(PlacementPolicy policy,
+ Collection<ContainerReplica> replicas, List<DatanodeDetails> usedNodes,
List<DatanodeDetails> excludedNodes,
Review Comment:
EC missing-index reconstruction still ignores the replica storage type.
This helper fixes the decommissioning and maintenance paths, but
processMissingIndexes still calls getTargetDatanodes(..., StorageType.DEFAULT)
and sends ReconstructECContainersCommand. That command has no storage-type
field, so an EC container whose surviving replica is on SSD or ARCHIVE can be
reconstructed onto a DISK volume (or any volume chosen by the target). Please
carry the source replica type through reconstruction target selection, the
command, and pending-op accounting.
--
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]