pivotal-eshu commented on code in PR #7596:
URL: https://github.com/apache/geode/pull/7596#discussion_r855679936


##########
geode-core/src/main/java/org/apache/geode/internal/cache/ColocationHelper.java:
##########
@@ -377,6 +378,26 @@ public static Map<String, LocalDataSet> 
getColocatedLocalDataSetsForBuckets(
    */
   public static List<PartitionedRegion> getColocatedChildRegions(
       PartitionedRegion partitionedRegion) {
+    List<PartitionedRegion> colocatedChildRegions =
+        getColocatedChildRegions(partitionedRegion, true, false);
+
+    // Fix for 44484 - Make the list of colocated child regions
+    // is always in the same order on all nodes.
+    Collections.sort(colocatedChildRegions, (o1, o2) -> {
+      if (o1.isShadowPR() == o2.isShadowPR()) {
+        return o1.getFullPath().compareTo(o2.getFullPath());
+      }
+      if (o1.isShadowPR()) {
+        return 1;
+      }
+      return -1;
+    });
+    return colocatedChildRegions;
+  }
+
+  @NotNull
+  private static List<PartitionedRegion> getColocatedChildRegions(

Review Comment:
   The newly added methods which only track child regions without wanQueue. 
They do not need to be sorted in current use case. When these method usage 
changes we can move the sorting there, but for now there is no need.



-- 
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]

Reply via email to