alb3rtobr opened a new pull request #6895:
URL: https://github.com/apache/geode/pull/6895


   When a partition redundant region is empty, `status redundancy` command 
shows a wrong redundancy value for that region.
   
   ```
   gfsh>status redundancy
   Number of regions with zero redundant copies = 0
   Number of regions with partially satisfied redundancy = 1
   Number of regions with fully satisfied redundancy = 0
   
   Redundancy is partially satisfied for regions: 
     test redundancy status: NOT_SATISFIED. Desired redundancy is 1 and actual 
redundancy is 2147483647.
   ```
   
   Problem is in `SerializableRegionRedundancyStatusImpl` class. The 
`calculateLowestRedundancy` initializes `minRedundancy` variable with 
`Integer.MAX_VALUE`. But for empty regions, all buckets have redundancy -1, so 
`minRedundancy` is not modified, and returned with that value.
   
   I propose to check `minRedundancy` value before returning it. If its value 
is `Integer.MAX_VALUE`, the region is empty so I think the method should return 
`0`.
   
   Notice that after this change, the redundancy status of an empty region will 
be reported as `RedundancyStatus.NO_REDUNDANT_COPIES` instead of 
`RedundancyStatus.NOT_SATISFIED`.
   
   
   
   


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