Prerequisites
This page assumes you have read and understood the following:- , which describes how the inheritance hierarchy of replication zones works. This is critical to understand for troubleshooting.
- , which is used to monitor if any of your cluster’s ranges are under-replicated, or if your data placement constraints are being violated.
- , which is the SQL statement used to view details about the replication zone configuration of various schema objects.
Types of problems
The most common types of problems you may encounter when are:- The replica location problem, a.k.a., “The replicas are not where they should be”. For replica location problems, the following may be involved:
- The replica state problem, a.k.a., “The replicas are not how they should be”. For replica state problems, the following may be involved:
If you just did a and are seeing problems with your zone configs, it may be because zone configs are overwritten by a cluster restore.
Troubleshooting steps
Use the following steps to determine which schema objects (if any) have zone configurations that are misconfigured. The examples assume a local multi-region cluster started using the following command:Step 1. Start with a target schema object
Look at the zone configuration for the schema object that you think may be misconfigured. Depending on the type of problem, you might have come to this conclusion by monitoring the critical nodes endpoint. Use the statement to inspect the target object’s zone configurations. For example, to view the zone configuration for themovr.rides table:
movr.users is using the zone configuration from its parent movr database. For more information about how this works, see .
However, if the zone configuration had been manually modified, there could be inconsistencies in the output that would show a misconfiguration.
For example:
- If the type of problem were a constraint violation, you’d want to check whether the values in , , and are logically inconsistent, which would cause constraint violations.
- If the type of problem were an under-replicated range, you’d want to check the values of and . Modifying these values can cause under-replication. For example,
num_replicascould be set too low. It’s also easy to make an arithmetic mistake when configuringnum_voters; ifnum_votersis less thannum_replicas, the difference dictates the number of . This is why most users should control non-voting replica placement with the high-level instead. - If , the value of may be too high.
Step 2. Move upward in the inheritance hierarchy as needed
If the target schema object looked good in Step 1, look at its parent schema object at the next level up in . This is the new target schema object. Return to the previous step and follow the instructions there. Continue this process recursively until you either find the misconfigured zone configuration or make it all the way up to and confirm that all of your schema objects have the expected zone configurations.Considerations
Monitor for ranges that are under-replicated or violating constraints
Monitor the output of the to see if you have ranges that are under-replicated or violating constraints. Using the range IDs from that endpoint, you can map from range IDs to schema objects as described in the following example. This will give you a target schema object to start from.- To monitor for under-replicated range IDs, see .
- To monitor for range IDs that are violating constraints, see .
101, we would know to look at the zone configuration(s) for the users table and the users_pkey primary index.
Replication system priorities: data placement vs. data durability
As noted in :Performance
Changes you make to a schema object’s zone configuration may take some time to be reflected in the schema object’s actual state, and can result in an increase in CPU usage, IOPS, and network traffic while the cluster rebalances replicas to meet the provided constraints. This is especially true for larger clusters. For more information about how replica rebalancing works, see .Zone configs are overwritten during cluster restore
During a , any present on the destination cluster are overwritten with the zone configurations from the . If no customized zone configurations were on the cluster when the backup was taken, then after the restore the destination cluster will use the zone configuration from the . For more information, see .See also
- : check the status of your cluster’s data replication, data placement, and zone constraint conformance.

