Rebalancing, replication and forest reordering
26 May 2016 12:23 PM
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.
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:
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.