Identifying Orphaned Partitions

To easily determine if your cluster has any orphaned partitions, run:

EXPLAIN REBALANCE PARTITIONS ON <database name>;

If there are any unbalanced partitions, a non-empty result set will be returned. If this is the case, run SHOW CLUSTER STATUS and SHOW PARTITIONS to see the details of your partitions:

Example:

SHOW CLUSTER STATUS;
| Host      | Port  | Database | Role      | State       | Position | Details |
+-----------+-------+----------+-----------+-------------+----------+---------+
| 127.0.0.1 | 10001 | x_test   | Reference | replicating | 0:57     |         |
| 127.0.0.1 | 10001 | x_test_0 | Master    | online      | 0:10     |         |
| 127.0.0.1 | 10001 | x_test_1 | Replica   | replicating | 0:10     |         |
| 127.0.0.1 | 10002 | x_test   | Reference | replicating | 0:57     |         |
| 127.0.0.1 | 10002 | x_test_0 | Replica   | replicating | 0:10     |         |
| 127.0.0.1 | 10002 | x_test_1 | Orphan    | online      | 0:10     |         |
SHOW PARTITIONS;
+---------+-----------+-------+---------+--------+
| Ordinal | Host      | Port  | Role    | Locked |
+---------+-----------+-------+---------+--------+
| 0       | 127.0.0.1 | 10001 | Master  | 0      |
| 0       | 127.0.0.1 | 10002 | Replica | 0      |
| 1       | 127.0.0.1 | 10001 | Replica | 0      |
+---------+-----------+-------+---------+--------+

Last modified: April 27, 2023

Was this article helpful?