Barrett Oglesby created GEODE-8366:
--------------------------------------

             Summary: A non-persistent partitioned region attached to a 
non-persistent gateway sender throws an exception if its leader co-located 
region is persistent
                 Key: GEODE-8366
                 URL: https://issues.apache.org/jira/browse/GEODE-8366
             Project: Geode
          Issue Type: Bug
          Components: wan
            Reporter: Barrett Oglesby


With this configuration:
{noformat}
<gateway-sender id="non_persistent_sender" parallel="true" 
enable-persistence="false" remote-distributed-system-id="1"/>

<region name="persistent_parent" refid="PARTITION_REDUNDANT_PERSISTENT"/>

<region name="non_persistent_child" refid="PARTITION_REDUNDANT">
  <region-attributes gateway-sender-ids="non_persistent_sender">
    <partition-attributes colocated-with="persistent_parent" 
redundant-copies="1"/>
  </region-attributes>
</region>
{noformat}
An exception is thrown, and the Cache fails to start.

The error and exception are:
{noformat}
[error 2020/07/16 14:06:59.908 PDT <main> tid=0x1] 
org.apache.geode.internal.cache.wan.GatewaySenderException: Non persistent 
gateway sender non_persistent_sender can not be attached to persistent region 
/persistent_parent
{noformat}
{noformat}
Exception in thread "main" 
org.apache.geode.internal.cache.wan.GatewaySenderException: Non persistent 
gateway sender non_persistent_sender can not be attached to persistent region 
/persistent_parent
        at 
org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue.addShadowPartitionedRegionForUserPR(ParallelGatewaySenderQueue.java:470)
        at 
org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue.addShadowPartitionedRegionForUserPR(ParallelGatewaySenderQueue.java:459)
        at 
org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderEventProcessor.addShadowPartitionedRegionForUserPR(ParallelGatewaySenderEventProcessor.java:195)
        at 
org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderQueue.addShadowPartitionedRegionForUserPR(ConcurrentParallelGatewaySenderQueue.java:183)
        at 
org.apache.geode.internal.cache.PartitionedRegion.postCreateRegion(PartitionedRegion.java:1201)
        at 
org.apache.geode.internal.cache.GemFireCacheImpl.createVMRegion(GemFireCacheImpl.java:3115)
        at 
org.apache.geode.internal.cache.GemFireCacheImpl.basicCreateRegion(GemFireCacheImpl.java:2975)
{noformat}
The ParallelGatewaySenderQueue.addShadowPartitionedRegionForUserPR method 
currently compares the data policy of the input region's leader region with the 
sender's persistence policy. It assumes the input region and the leader region 
have the same data policy. In this scenario, that is not the case. The input 
region is 'non_persistent_child' which is not persistent, and the leader region 
is 'persistent_parent' which is persistent. The sender is 
'non_persistent_sender' which is not persistent. So, instead of comparing the 
data policy of 'non_persistent_child' to the sender which would succeed since 
they are both not persistent, it compares the data policy of 
'persistent_parent' to the sender which fails since one is persistent, and the 
other is not.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to