You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/01/03 22:11:22 UTC

[GitHub] [geode] mhansonp commented on a change in pull request #7124: GEODE-9815: Prefer to remove a redundant copy in the same zone

mhansonp commented on a change in pull request #7124:
URL: https://github.com/apache/geode/pull/7124#discussion_r777728832



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/model/PartitionedRegionLoadModel.java
##########
@@ -435,10 +435,24 @@ private void initLowRedundancyBuckets() {
 
   private void initOverRedundancyBuckets() {
     this.overRedundancyBuckets = new TreeSet<>(REDUNDANCY_COMPARATOR);
+    Set<String> redundancyZones = new HashSet<>();
+
     for (BucketRollup b : this.buckets) {
-      if (b != null && b.getOnlineRedundancy() > this.requiredRedundancy) {
-        this.overRedundancyBuckets.add(b);
+      if (b != null) {
+        if (b.getOnlineRedundancy() > this.requiredRedundancy) {
+          this.overRedundancyBuckets.add(b);
+        } else {
+          for (Member member : b.getMembersHosting()) {
+            String redundancyZone = this.getRedundancyZone(member.getDistributedMember());
+            if (redundancyZones.contains(redundancyZone)) {

Review comment:
       I have rewritten most of the tests as JUnit tests, as well as fixing the a couple of issues I found in the code. Please review when you get the chance.




-- 
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: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org