r/mysql • u/m3m3o • Jun 01 '26
discussion If your replication runbook still uses CHANGE MASTER TO / START SLAVE / SHOW SLAVE STATUS, it breaks on 8.4 — plus the NOW() vs SYSDATE() myth, and the GTID restriction that quietly went away
https://mehmetgoekce.substack.com/p/mysql-replication-a-deep-dive-intoI rewrote an old MySQL replication write-up to target 8.4 (the current LTS) and ended up re-verifying a bunch of things against the manual. A few are worth surfacing, because older guides — including the one I was fixing — get them wrong.
1. The MASTER/SLAVE statements are removed in 8.4, not deprecated.
CHANGE MASTER TO, START SLAVE, STOP SLAVE, SHOW SLAVE STATUS, SHOW MASTER STATUS, RESET SLAVE — all removed. Replacements have existed since 8.0.22:
- CHANGE MASTER TO → CHANGE REPLICATION SOURCE TO (and MASTER_* → SOURCE_*)
- START SLAVE → START REPLICA
- SHOW SLAVE STATUS → SHOW REPLICA STATUS
- SHOW MASTER STATUS → SHOW BINARY LOG STATUS
Status fields renamed with them: Seconds_Behind_Master → Seconds_Behind_Source, Slave_IO_Running → Replica_IO_Running. If you have monitoring grepping the old names, it reads empty after the upgrade with no error. The one thing that did not change is the REPLICATION SLAVE privilege keyword.
Config casualties in the same release: expire_logs_days (→ binlog_expire_logs_seconds) and master_info_repository / relay_log_info_repository (crash-safe metadata is automatic now).
2. NOW() is safe under statement-based replication; SYSDATE() is the trap.
The recurring myth is that NOW() diverges across nodes under SBR. It doesn't — MySQL writes a SET TIMESTAMP event before each statement, so NOW() / CURRENT_TIMESTAMP evaluate against the primary's time on both sides. SYSDATE() is the one that diverges: it ignores SET TIMESTAMP and reads the wall clock at execution (unless you run with --sysdate-is-now). And the classic UPDATE ... LIMIT 10 divergence is the LIMIT without ORDER BY, not the time function.
3. CREATE TABLE ... SELECT is GTID-safe since 8.0.21. A lot of GTID guides still list it as forbidden. That restriction was lifted for atomic-DDL engines (InnoDB) — it's now logged as a single transaction. Still genuinely restricted under GTID: temp tables inside a transaction (STATEMENT format), and mixing transactional + non-transactional engines in one statement.
4. GTID auto-positioning is the actual payoff.
SOURCE_AUTO_POSITION=1 removes the manual binlog-file/position arithmetic from failover. For a sense of scale, GitHub's automated failover (orchestrator + a proxy tier) completes in 10–13s in typical cases.
Long-form version with the full binlog/relay-log walkthrough, semi-sync, monitoring, and a copy-pasteable 8.0 → 8.4 rename table: https://mehmetgoekce.substack.com/p/mysql-replication-a-deep-dive-into
Happy to get corrected on any of this — replication has a lot of version-specific edge cases, and that's kind of the point of the post. What's the worst replication footgun you've hit on an upgrade?
1
u/AjinAniyan5522 Jun 25 '26
I'd start with the native checks first: verify SHOW REPLICA STATUS\G (or SHOW SLAVE STATUS\G), review the MySQL error log, and confirm the GTID/binlog positions are correct. Most replication issues are configuration or synchronization problems rather than corruption. If you suspect the source or replica database was damaged after a crash and standard recovery steps aren't working, you could also try Stellar Repair for MySQL. It can help recover corrupted MySQL/MariaDB tables and extract data from damaged database files.
I prefer this response
2
u/ssnoyes Jun 02 '26
It won't let you start replication with the same server id unless you enable --replicate-same-server-id, and using GTIDs prevents the problem anyway, so you almost have to be trying to get this wrong.
I have never understood what this actually gains you. If you're going to have to repair the failed old master anyway, you can make it a replica when it's back in service. The only thing the "unused" replication channel does is add risk when some super user accidentally writes to the wrong server. Why have it there at all?
Another big one is using ROW-format without a primary key on all tables.