Pivotal Knowledge Base

Follow

Using PARTITION_REDUNDANT and Partition-Attributes Results in 0 Redundant Copies

Environment

 Product  Version
 Pivotal GemFire  7.x - 9.x
 OS  All Supported OS

Symptom

The attribute redundantCopies is set to 0 even though refid="PARTITION_REDUNDANT." For example:

 <region name="ExampleRegion">
<region-attributes refid="PARTITION_REDUNDANT">
<partition-attributes recovery-delay="1000"/>
</region-attributes>
</region>

From the fine log, redundantCopies is also shown as 0 like this:

[fine 2016/10/31 18:42:39.994 CST server1  tid=0x1] PartitionRegion#initialize: finished with Partitioned Region @49c44295 [path='/ExampleRegion'; dataPolicy=PARTITION; gatewayEnabled=false; prId=6; isDestroyed=false; isClosed=false; retryTimeout=3600000; serialNumber=580; partition attributes=PartitionAttributes@695378429[redundantCopies=0;localMaxMemory=603;totalMaxMemory=2147483647;totalNumBuckets=113;partitionResolver=null;colocatedWith=null;recoveryDelay=1000;startupRecoveryDelay=0;FixedPartitionAttributes=null;partitionListeners=null]; on VM pivhdsne(server1:198659):50025]

 

Cause

The shortcut PARTITION_REDUNDANT should be equal to using the PARTITION data-policy and settings redundant-copies to 1. But since the cache.xml also defines partition-attributes (in the example above recovery-delay is used), the redundant-copies value will be overwritten by redundant-copies's default value which is 0. 

Resolution

We can simply resolve this issue by adding redundant-copies=1 to partition-attributes definition. For example:

 <region name="TOC_SUBS"> 
<region-attributes refid="PARTITION_REDUNDANT">
<partition-attributes redundant-copies="1" recovery-delay="1000"/>
</region-attributes>
</region>

Then the fine log-level log is shown like below:

[fine 2016/10/31 18:42:39.994 CST server1  tid=0x1] PartitionRegion#initialize: finished with Partitioned Region @49c44295 [path='/ExampleRegion'; dataPolicy=PARTITION; gatewayEnabled=false; prId=6; isDestroyed=false; isClosed=false; retryTimeout=3600000; serialNumber=580; partition attributes=PartitionAttributes@695378429[redundantCopies=1;localMaxMemory=603;totalMaxMemory=2147483647;totalNumBuckets=113;partitionResolver=null;colocatedWith=null;recoveryDelay=1000;startupRecoveryDelay=0;FixedPartitionAttributes=null;partitionListeners=null]; on VM pivhdsne(server1:198659):50025]

 

 

Comments

Powered by Zendesk