feat: 🦭 MariaDB support 🦭#1724
Conversation
gh-ost mostly works against MariaDB unchanged; this makes the few MariaDB-specific spots correct and runs the replica test suite against MariaDB 11.4 and 11.8 (LTS) alongside the MySQL/Percona flavors. Core: - ReplicaTermFor keeps the legacy slave/master replication terminology on MariaDB. MariaDB reports versions >= 10 (greater than the 8.4 cutoff) but never adopted the new replica/source terms, and its SHOW REPLICA STATUS still emits legacy column names, so the MySQL 8.4 term map doesn't apply. - Accept BINLOG MONITOR as well as REPLICATION CLIENT in the grant check (MariaDB 10.5+ renamed the privilege). Test harness (localtests): - test.sh: pick slave/Master terminology for MariaDB, wait for replica catch-up via MASTER_GTID_WAIT/gtid_binlog_pos, and skip gtid_mode-gated tests where @@gtid_mode is unsupported instead of aborting the run. - Resolve the per-flavor config dir by specificity (docker/<flavor>-<major.minor>, then <flavor>-<major>, then bare <flavor>) so versions that share one config live in a single dir. All MariaDB versions use one docker/mariadb dir (log-bin + ROW + log-slave-updates, native-auth users, MariaDB-GTID replication, MYSQL_CLIENT=mariadb since 11.x dropped the mysql-named client); a version (or major line) needing different config overrides it by adding its own dir. The compose healthcheck honours MYSQL_CLIENT. - Make the zero-date failure tests deterministic across flavors with an explicit sql_mode (NO_ZERO_IN_DATE,NO_ZERO_DATE,...); they relied on MySQL's default sql_mode, which MariaDB doesn't share. - Drop the incidental NOT NULL from the generated-column tests (MariaDB forbids NOT NULL on generated columns) so they run on MariaDB; keep generated-columns-unique skipped (it puts a generated column in the PRIMARY KEY, which MariaDB forbids, Error 1903). - Add mariadb:11.4.12 and mariadb:11.8.8 to the CI matrix.
Add the MariaDB 10.x LTS lines (10.5, 10.6, 10.11) to the replica test suite. MariaDB versions below 11.1 need one core fix: gh-ost passes transaction_isolation as a DSN param, which the driver applies as `SET transaction_isolation=<v>` on each connection. That system variable does not exist on MariaDB < 11.1 (which has only tx_isolation), so the connection fails with Error 1193 "Unknown system variable 'transaction_isolation'". tx_isolation was in turn removed in MySQL 8.0, so no single variable name is portable across the supported servers. - mysql.OpenDB strips the transaction_isolation param and instead runs the SQL-standard `SET SESSION TRANSACTION ISOLATION LEVEL <level>` on each new connection via a connector wrapper, accepted by every supported MySQL and MariaDB version. GetDBUri still emits the param unchanged, so DSN construction and its tests are unaffected. - Add mariadb:10.5.29, mariadb:10.6.27 and mariadb:10.11.18 to the CI matrix.
|
This is great! 🚀 🚀 |
| fail-fast: false | ||
| matrix: | ||
| image: ['mysql:5.7.41','mysql:8.0.41','mysql:8.4.3','percona/percona-server:8.0.41-32'] | ||
| image: ['mysql:5.7.41','mysql:8.0.41','mysql:8.4.3','percona/percona-server:8.0.41-32','mariadb:10.5.29','mariadb:10.6.27','mariadb:10.11.18','mariadb:11.4.12','mariadb:11.8.8'] |
There was a problem hiding this comment.
Can we restrict the CI tests to one MariaDB version, or one for 10.x and one for 11.x?
There was a problem hiding this comment.
They're all LTS releases, except 10.5, which is EOL already. If you think it's too much, I can remove some of them, let me know what you think.
There was a problem hiding this comment.
should be fine actually 👍 I'm wondering what versions should be officially supported? I don't have experience with MariaDB in production
There was a problem hiding this comment.
I picked the versions based on what AWS currently supports, i.e. several versions from every LTS line, except 10.5. I decided to include 10.5 too since it's MariaDB's equivalent of MySQL 5.7, which is also covered by gh-ost's CI.

Closes #725.
🦭 MariaDB support 🦭
The PR is split in 2 commits:
Both commits pass the test suite and can be merged separately (if needed).
MariaDB 11.x support
gh-ost mostly works against MariaDB unchanged; this commit makes the few
MariaDB-specific notable spots correct and runs the replica test suite against
MariaDB 11.4 and 11.8 (LTS) alongside the MySQL/Percona flavors.
Core:
MariaDB. MariaDB reports versions >= 10 (greater than the 8.4 cutoff) but
never adopted the new replica/source terms, and its SHOW REPLICA STATUS
still emits legacy column names, so the MySQL 8.4 term map doesn't apply.
(MariaDB 10.5+ renamed the privilege).
Test harness (localtests):
catch-up via MASTER_GTID_WAIT/gtid_binlog_pos, and skip gtid_mode-gated
tests where @@gtid_mode is unsupported instead of aborting the run.
then -, then bare ) so versions that share one config
live in a single dir. All MariaDB versions use one docker/mariadb dir.
explicit sql_mode (NO_ZERO_IN_DATE,NO_ZERO_DATE,...); they relied on MySQL's
default sql_mode, which MariaDB doesn't share.
forbids NOT NULL on generated columns) so they run on MariaDB; keep
generated-columns-unique skipped (it puts a generated column in the PRIMARY
KEY, which MariaDB forbids, Error 1903).
MariaDB 10.x support
Add the MariaDB 10.x LTS lines (10.5, 10.6, 10.11) to the replica test suite.
MariaDB versions below 11.1 need one core fix: gh-ost passes transaction_isolation as
a DSN param, which the driver applies as
SET transaction_isolation=<v>on eachconnection. That system variable does not exist on MariaDB < 11.1 (which has
only tx_isolation), so the connection fails with Error 1193 "Unknown system
variable 'transaction_isolation'". tx_isolation was in turn removed in MySQL
8.0, so no single variable name is portable across the supported servers.
SQL-standard
SET SESSION TRANSACTION ISOLATION LEVEL <level>on each newconnection via a connector wrapper, accepted by every supported MySQL and
MariaDB version. GetDBUri still emits the param unchanged, so DSN
construction and its tests are unaffected.
script/cibuildreturns with no formatting errors, build errors or unit test errors.