Currently, we are running the following steps:
- Stateful Set - Run data nodes:
- (If restoring) InitContainer: Download native backups on data nodes (TODO: Do this in Job A)
- Main container: Run data nodes
- (If restoring) Job A - Restore binary data:
- Wait for data nodes to start up
- Create temporary MySQLd that connects to the data nodes and creates system tables (important!). Otherwise, system tables will be restored by native backup.
- TODO: Download native backups on data nodes here instead
- Run
ndb_restore --restore-meta --disable-indexes
on one ndbmtd - Run
ndb_restore --restore-data
on all ndbmtds - Run
ndb_restore --rebuild-indexes
on one ndbmtd - (If global secondary cluster) Run
ndb_restore --restore-epoch
on one ndbmtd - Remove native backups on all ndbmtds
- (If global primary cluster) Stateful Set - Run MySQL binlog servers:
- InitContainer: Initialize MySQLd data dir (no connection needed)
- Wait for data nodes to start up
- (If restoring) Wait for Job A
- Main container: Run MySQLd replication servers with networking
- Allow listening to the restore of a backup
- Job B - Initialize MySQLds:
- (If restoring) Download MySQL metadata backup
- Wait for data nodes to start up
- (If restoring) Wait for Job A
- (If global primary cluster) Wait for binlog servers
- Spawn temporary MySQLd that:
- (If restoring) Restores MySQL metadata backup
- Applies Helm deployment SQL init files
- Applies user-applied SQL init files
- (If global secondary cluster) Stateful Set - Run MySQL replica applier
- InitContainer: Initialize MySQLd data dir (no connection needed)
- Wait for Job B
- Main containers:
- MySQLd
- Replication operator; script to choose binlog server & start/stop replication
- Stateful Set - Run MySQL servers:
- InitContainer: Initialize MySQLd data dir (no connection needed)
- Wait for Job B
- Main container: Run MySQLds with networking
Note: Global primary and secondary cluster refer to global replication. This is asynchronous replication between MySQL replication servers of two clusters. MySQL binlog servers in the primary cluster replicate towards the MySQL replica appliers in the secondary cluster.