Using PARTITION_REDUNDANT and Partition-Attributes Results in 0 Redundant Copies
search cancel

Using PARTITION_REDUNDANT and Partition-Attributes Results in 0 Redundant Copies

book

Article ID: 294219

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

Symptoms:

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]

Environment


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 the default value of redundant-copies 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]