You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-ost hard-coded the go-mysql binlog syncer to MySQLFlavor and parsed
every GTID set as MySQL, so --gtid could not be used against MariaDB.
go-mysql already speaks the MariaDB GTID dialect; this wires it up.
- Detect server flavor from the version string (IsMariaDB / FlavorFor)
and set it on the BinlogSyncerConfig.
- Make GTIDBinlogCoordinates hold the flavor-agnostic gomysql.GTIDSet
interface; parse via ParseGTIDSet(flavor, ...).
- Handle MariadbGTIDEvent alongside GTIDEvent in the streamer, and read
the committed GTID set from XIDEvent.GSet without a MySQL-only cast.
- Read MariaDB GTID positions from @@global.gtid_binlog_pos,
Gtid_IO_Pos and @@global.gtid_slave_pos (MariaDB has no
Executed_Gtid_Set column nor gtid_mode / enforce_gtid_consistency).
- Skip the gtid_mode / enforce_gtid_consistency validation on MariaDB,
where GTIDs are always recorded when binary logging is enabled.
localtests:
- Detect the server version once and reuse it; run gtid_mode=ON tests on
MariaDB (normalize its current_gtid_mode to ON) and trim the GTID
diagnostics that don't exist on MariaDB.
- Enable gtid_strict_mode on the MariaDB test servers. Because
--test-on-replica makes gh-ost write locally on the replica, give the
replica its own GTID domain so its writes never collide with the
primary's domain-0 stream under strict mode.
- Add the gtid-resume case: interrupt a --gtid migration mid-copy via the
interactive 'panic' command, then --resume, exercising the GTID
checkpoint round-trip (WriteCheckpoint persists the GTID set,
ReadLastCheckpoint parses it back via NewGTIDBinlogCoordinates(flavor)).
Passes across the MySQL, MariaDB and Percona CI matrix.
Verified: full localtests suite passes on MySQL 5.7/8.0/8.4 and on the
MariaDB matrix (10.5, 10.6, 10.11, 11.4, 11.8) with gtid_strict_mode on.
Copy file name to clipboardExpand all lines: doc/command-line-flags.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -218,7 +218,9 @@ Add this flag when executing on a 1st generation Google Cloud Platform (GCP).
218
218
219
219
### gtid
220
220
221
-
Add this flag to enable support for [MySQL replication GTIDs](https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html) for replication positioning. This requires `gtid_mode` and `enforce_gtid_consistency` to be set to `ON`.
221
+
Add this flag to enable support for [MySQL replication GTIDs](https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html) for replication positioning. On MySQL this requires `gtid_mode` and `enforce_gtid_consistency` to be set to `ON`.
222
+
223
+
[MariaDB GTIDs](https://mariadb.com/kb/en/gtid/) are also supported: gh-ost detects the server flavor automatically and uses the appropriate GTID dialect. MariaDB has no `gtid_mode`/`enforce_gtid_consistency` settings — GTIDs are always recorded when binary logging is enabled, so no extra configuration is required beyond `--gtid`.
0 commit comments