kirklund commented on a change in pull request #7440:
URL: https://github.com/apache/geode/pull/7440#discussion_r824943107



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/DestroyRegionOperation.java
##########
@@ -167,32 +167,23 @@ public void run() {
           Throwable thr = null;
           try {
             if (lclRgn == null) {
-              // following block is specific to buckets...
-              // need to wait for queued bucket profiles to be processed
-              // or this destroy may do nothing and result in a stale profile
-              boolean waitForBucketInitializationToComplete = true;
-              CacheDistributionAdvisee advisee = null;
               try {
-                advisee = 
PartitionedRegionHelper.getProxyBucketRegion(dm.getCache(), regionPath,
-                    waitForBucketInitializationToComplete);
-              } catch (PRLocallyDestroyedException ignore) {
-                // region not found - it's been destroyed
+                PartitionedRegion partitionedRegion = PartitionedRegionHelper
+                    .getPartitionedRegionUsingBucketRegionName(dm.getCache(), 
regionPath);
+                String bucketName = 
PartitionedRegionHelper.getBucketName(regionPath);
+                if (partitionedRegion != null && bucketName != null) {
+                  int bucketId = 
PartitionedRegionHelper.getBucketId(bucketName);
+                  
partitionedRegion.getRegionAdvisor().removeIdAndBucket(bucketId, getSender(),
+                      serialNum, op.isRegionDestroy() && !op.isClose());
+                }
               } catch (RegionDestroyedException ignore) {
-                // ditto
+                // region not found - it's been destroyed

Review comment:
       How about `// nothing to do because Region is already destroyed`?




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