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 2021/09/24 17:29:00 UTC

[GitHub] [geode] DonalEvans commented on a change in pull request #6895: GEODE-9624: Fix 'status redundancy' result for empty regions

DonalEvans commented on a change in pull request #6895:
URL: https://github.com/apache/geode/pull/6895#discussion_r715789080



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/control/SerializableRegionRedundancyStatusImpl.java
##########
@@ -53,7 +53,7 @@ public SerializableRegionRedundancyStatusImpl(PartitionedRegion region) {
    * @param region The region for which the lowest redundancy should be calculated.
    * @return The redundancy of the least redundant bucket in the region.
    */
-  private int calculateLowestRedundancy(PartitionedRegion region) {
+  int calculateLowestRedundancy(PartitionedRegion region) {
     int numBuckets = region.getPartitionAttributes().getTotalNumBuckets();
     int minRedundancy = Integer.MAX_VALUE;

Review comment:
       I was the original author of this, so I hope Alberto doesn't mind me answering for him. We're calculating the minimum redundancy level for a partitioned region, defined as the minimum redundancy level among all of its buckets, so given that any bucket may have a redundancy value between -1 (bucket does not exist) and N, the only sensible way to find the minimum is to start at the max value and reduce it as we find smaller values. If we started with the minimum redundancy at 0, we'd have no way of keeping track of what the lowest value for redundancy was among all the buckets.




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