Maintenance, including MySQL admin or schema updates, should not be performed directly on a Primary as this may upset the replication and therefore availability and functionality of the Replicas which are reading from the Primary.
To effectively make the modifications, you should switch the Primary host, then operate on the Primary as if it were Replica, removing it from the replicator service configuration. This helps to minimize any problems or availability that might be cause by performing operations directly on the Primary.
The complete sequence and commands required to perform maintenance on an active Primary are shown in the table below. The table assumes a dataservice with three datasources:
Switch Primary to ||See Section 7.11, “Switching Primary Hosts”||Replica||Primary||Replica|
|3||Put Replica into OFFLINE state||trepctl -host host1 offline||Offline||Primary||Replica|
Validate the ||tpm validate||Offline||Primary||Replica|
|6||Put the Replica online||trepctl -host host1 online||Replica||Primary||Replica|
|7||Ensure the Replica has caught up||trepctl -host host1 status||Replica||Primary||Replica|
Switch Primary back to
||See Section 7.11, “Switching Primary Hosts”||Primary||Replica||Replica|