You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/05/28 11:23:58 UTC
[GitHub] [ozone] GlenGeng commented on a change in pull request #2291: replication manager will delete over-replicated container with storage utilization priority
GlenGeng commented on a change in pull request #2291:
URL: https://github.com/apache/ozone/pull/2291#discussion_r641474736
##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
##########
@@ -878,6 +871,24 @@ private void handleOverReplicatedContainer(final ContainerInfo container,
Set<ContainerReplica> eligibleSet = new HashSet<>(eligibleReplicas);
ContainerPlacementStatus ps =
getPlacementStatus(eligibleSet, replicationFactor);
+
+ // Iterate replicas in deterministic order to avoid potential data loss.
+ // See https://issues.apache.org/jira/browse/HDDS-4589.
+ // N.B., sort replicas by (containerID, datanodeDetails).
+ // what is more , for all the deletion candidate replicas,
+ // we always delete the one with highest storage.
+ // See https://issues.apache.org/jira/browse/HDDS-5278
+ eligibleReplicas.sort((r1, r2) -> {
+ int result = nodeManager.getNodeStatInternal(r1.getDatanodeDetails())
+ .compareByRemainingRatio(nodeManager.
Review comment:
Can sorting based on usage be deterministic, and theoretically avoid the potential data loss issue?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org