Solutions

MarkLogic Data Hub Service

Fast data integration + improved data governance and security, with no infrastructure to buy or manage.

Learn More

Learn

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Community

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Company

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

 
Knowledgebase:
Rebalancing, replication and forest reordering
26 May 2016 12:23 PM

Context

This KB article talks specifically about how the Rebalancer interacts with database replication, and how to solve the issues that may arise if not configured correctly.

For a general discussion on how rebalancing works in MarkLogic, refer to this article and the server documentation.

Rebalancing and replication

When database replication is configured for a database, rebalancing will not take place on Replica until database replication is broken. Until the time when the primary is available, forest to forest mapping will remain.

It is important to make sure that the assignment policy on the Replica is the same as the Master - so that in a DR situation, when the Replica takes over as the Primary, rebalancing is not triggered.

Forest order mismatch can cause Rebalancing

Forest order is the order in which forests are attached the the database. When the document assignment policy is set to either 'Legacy' or 'Bucket', it is required that the Replica database configuration should have the same forest order as the Master to ensure rebalancing does not occur if or when replication is deconfigured.

If there is a difference in forest orders between the Master and the Replica, a Warning level message is logged on the Replica, which looks like this:

2015-10-21 13:34:59.359 Warning: forest order mismatch: local forest Test_12 is at position 15 
while foreign master forest 2108358988113530610 (cluster=8893136914265436826) is at position 12

In this state, when replication is broken, and the Replica takes over as the primary, then rebalancing starts off and it could take variable amount of time depending on how many documents need to be rebalanced.

Fixing the forest order:

The following steps help in removing the mismatch and making the forest order same on both Master and Replica:

i. Break/deconfigure replication

ii. Disable rebalancing on both clusters for the database in question.

iii. Obtain the forest order from the Master cluster - below is the query:

iv. On the Replica cluster, reorder the forests according to the order returned on the Master from step iii:

v. Re-enable rebalancing on both clusters, and let it finish if it starts rebalancing

vi. Reconfigure replication.

Again, make sure that the assignment policy is the same on both the clusters.

(0 vote(s))
Helpful
Not helpful

Comments (0)