Replica Move Example for MariaDB Xpand
This page is part of MariaDB's Documentation.
The parent of this page is: MariaDB Xpand Rebalancer
Topics on this page:
Overview
MariaDB Xpand's Rebalancer automatically moves a replicas to a new node to ensure that read and write requests are distributed evenly between nodes.
Compatibility
Information provided here applies to:
MariaDB Xpand 5.3
MariaDB Xpand 6.0
MariaDB Xpand 6.1
Beginning State
At the start of this example, replicas of Slice 1 reside on Xpand nodes node3
and node4
.
Copy Replica
MariaDB Xpand decides to move the non-ranking replica from node4
to node1
:
A new replica is created on
node1
The new replica is initially empty
The new replica is marked as "building", so that queries do not access it
Xpand begins copying data from the non-ranking replica on
node4
into the empty replica onnode1
If the slice receives any writes, the writes are written to a Recovery Queue for the slice on
node2
Xpand considers the Recovery Queue to be another replica for the slice
Replay Recovery Queue
After the replica is copied from node4
to node1
, MariaDB Xpand asynchronously replays transactions in the Recovery Queue.
Disable Recovery Queue
After the transactions in the Recovery Queue have been replayed, the Recovery Queue is disabled:
The Recovery Queue is no longer updated by new transactions
The Recovery Queue is still updated by older transactions, and the updates are applied synchronously to the new replica
The old replica is retired and the new replica is made available
Transactions that started before the update still see the old replica, but the old replica no longer receives new writes