You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bo...@apache.org on 2020/07/16 21:32:26 UTC

[geode] branch feature/GEODE-8366 created (now cc53250)

This is an automated email from the ASF dual-hosted git repository.

boglesby pushed a change to branch feature/GEODE-8366
in repository https://gitbox.apache.org/repos/asf/geode.git.


      at cc53250  GEODE-8366: Compared the input region's data policy rather than the leader region's to the sender

This branch includes the following new commits:

     new cc53250  GEODE-8366: Compared the input region's data policy rather than the leader region's to the sender

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[geode] 01/01: GEODE-8366: Compared the input region's data policy rather than the leader region's to the sender

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

boglesby pushed a commit to branch feature/GEODE-8366
in repository https://gitbox.apache.org/repos/asf/geode.git

commit cc53250ab8dc2451416ff3545dea9181fdb46667
Author: Barry Oglesby <bo...@pivotal.io>
AuthorDate: Thu Jul 16 14:29:38 2020 -0700

    GEODE-8366: Compared the input region's data policy rather than the leader region's to the sender
---
 .../wan/parallel/ParallelGatewaySenderQueue.java   | 29 ++++++++++++++--------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index f8f3642..8e12c00 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -438,6 +438,11 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   }
 
   public void addShadowPartitionedRegionForUserPR(PartitionedRegion userPR) {
+    addShadowPartitionedRegionForUserPR(userPR, null);
+  }
+
+  public void addShadowPartitionedRegionForUserPR(PartitionedRegion userPR,
+      PartitionedRegion leaderRegion) {
     if (logger.isDebugEnabled()) {
       logger.debug("{} addShadowPartitionedRegionForUserPR: Attempting to create queue region: {}",
           this, userPR.getDisplayName());
@@ -449,16 +454,17 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
       String regionName = userPR.getFullPath();
       // Find if there is any parent region for this userPR
       // if there is then no need to add another q for the same
-      String leaderRegionName = ColocationHelper.getLeaderRegion(userPR).getFullPath();
-      if (!regionName.equals(leaderRegionName)) {
-        // Fix for defect #50364. Allow user to attach GatewaySender to child PR (without attaching
-        // to leader PR)
-        // though, internally, colocate the GatewaySender's shadowPR with the leader PR in
-        // colocation chain
-        if (!this.userRegionNameToShadowPRMap.containsKey(leaderRegionName)) {
-          addShadowPartitionedRegionForUserPR(ColocationHelper.getLeaderRegion(userPR));
+      if (leaderRegion == null) {
+        String leaderRegionName = ColocationHelper.getLeaderRegion(userPR).getFullPath();
+        if (!regionName.equals(leaderRegionName)) {
+          // Fix for defect #50364. Allow user to attach GatewaySender to child PR (without
+          // attaching to leader PR) though, internally, colocate the GatewaySender's shadowPR with
+          // the leader PR in colocation chain
+          if (!this.userRegionNameToShadowPRMap.containsKey(leaderRegionName)) {
+            addShadowPartitionedRegionForUserPR(userPR, ColocationHelper.getLeaderRegion(userPR));
+          }
+          return;
         }
-        return;
       }
 
       if (this.userRegionNameToShadowPRMap.containsKey(regionName))
@@ -570,7 +576,8 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
 
     } finally {
       if (prQ != null) {
-        this.userRegionNameToShadowPRMap.put(userPR.getFullPath(), prQ);
+        this.userRegionNameToShadowPRMap
+            .put((leaderRegion == null ? userPR : leaderRegion).getFullPath(), prQ);
       }
       /*
        * Here, enqueueTempEvents need to be invoked when a sender is already running and userPR is
@@ -581,7 +588,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
       if ((this.index == this.nDispatcher - 1) && this.sender.isRunning()) {
         ((AbstractGatewaySender) sender).enqueueTempEvents();
       }
-      afterRegionAdd(userPR);
+      afterRegionAdd(leaderRegion == null ? userPR : leaderRegion);
       this.sender.getLifeCycleLock().writeLock().unlock();
     }
   }