amaliujia commented on a change in pull request #1700:
URL: https://github.com/apache/ozone/pull/1700#discussion_r543663504
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
##########
@@ -720,6 +721,12 @@ private void handleOverReplicatedContainer(final
ContainerInfo container,
final List<ContainerReplica> eligibleReplicas = new
ArrayList<>(replicas);
+ // 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).
+ eligibleReplicas.sort(
+ Comparator.comparingLong(ContainerReplica::hashCode));
Review comment:
So it seems will be hard to write a test to verify the case in HDDS-4589
:)
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]