mariadb-core-replication-model
Installation
SKILL.md
mariadb-core-replication-model
Architectural reference for MariaDB replication. Covers the three replication shapes, the MariaDB-specific GTID format, binary log formats, the parallel-applier model, and multi-source replication. Topology setup details and recovery procedures live in references/.
Quick Reference
- Async is the default. Primary writes the binary log, replica I/O thread fetches events into the relay log, replica SQL thread (or parallel workers) applies them. The primary does NOT wait for replicas. RPO depends on replication lag.
- Semi-sync is built into the server from MariaDB 10.3+. NEVER install a separate plug-in on 10.3 or later. Enable via
rpl_semi_sync_master_enabled=ONon the primary plusrpl_semi_sync_slave_enabled=ONon the replica. Defaultrpl_semi_sync_master_timeoutis 10000 ms ; on timeout the primary reverts to async until a replica re-ack. - Parallel-applier default mode is
optimisticsince MariaDB 10.5.1+. Older 10.5.0 and earlier usedconservative. Set worker pool withslave_parallel_threads. Both primary and replica MUST be MariaDB 10.0.5 or later. - MariaDB GTID format is
domain-server-sequence(for example0-1-1234). MySQL GTID format isuuid:seqno. The schemes are NOT interconvertible. Per the KB : "MariaDB can be a replica for a MySQL primary, but MySQL cannot be a replica for a MariaDB primary." Migration between the two with GTID is a one-shot dump-and-load, NEVER continuous GTID-tracked replication. - Binary log default format is
MIXEDsince MariaDB 10.2.4 (wasSTATEMENTuntil 10.2.3). MIXED auto-switches to row-encoding when a statement is unsafe (non-deterministic functions,LIMITwithoutORDER BY, certain stored routines). UseROWexplicitly for Galera and for any cluster that cannot tolerate replication drift. binlog_row_imagedefault isFULL. Other values :MINIMAL,NOBLOB; MariaDB 11.4+ addsFULL_NODUP. NEVER setMINIMALin environments that need point-in-time recovery with full row reconstruction.- Multi-source replication uses NAMED CONNECTIONS, not
FOR CHANNEL. Syntax isCHANGE MASTER 'connection_name' TO .... TheFOR CHANNELsyntax is MySQL-only. Connection names are case-insensitive. UseSHOW ALL SLAVES STATUSto see all channels at once. Seconds_Behind_Masteris unreliable. It measures the timestamp on the SQL thread relative to the event being applied, NOT actual wall-clock lag. Usept-heartbeat(or the equivalent token-based heartbeat) for accurate lag measurement.