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 2020/10/02 18:33:02 UTC

[GitHub] [geode] jinmeiliao commented on a change in pull request #5577: GEODE-7845 blocking PR region clear if one or more server versions are too old

jinmeiliao commented on a change in pull request #5577:
URL: https://github.com/apache/geode/pull/5577#discussion_r498981996



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
##########
@@ -5328,6 +5328,22 @@ public int getTotalNumberOfBuckets() {
     return this.totalNumberOfBuckets;
   }
 
+  /**
+   * This method returns a boolean to indicate if all server versions support Partition Region clear
+   */
+  public boolean allServerVersionsSupportPartitionRegionClear() {
+    for (int i = 0; i < getTotalNumberOfBuckets(); i++) {

Review comment:
       I am not very familiar with how PR is implemented, but is `getTotalNumberOfBuckets` returns the bucket counts for this server only or for the entire region?

##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionClear.java
##########
@@ -362,6 +367,10 @@ void doClear(RegionEventImpl regionEvent, boolean cacheWrite) {
       try {
         Set<Integer> bucketsCleared = clearRegion(regionEvent);
 
+        if (!partitionedRegion.allServerVersionsSupportPartitionRegionClear()) {

Review comment:
       why are we doing the check here again? I though we only need to check it before we send out the message.




----------------------------------------------------------------
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:
users@infra.apache.org