Commit 9e188c8
committed
fix(replication): treat MariaDB 11+ like 10.x in GreaterOrEqualVersion
Closes #82.
`common.GreaterOrEqualVersion(version, comparedTo)` carries a long-standing
guard for MariaDB 10:
if major == 10 {
return false, nil
}
The intent was to keep flavor-blind version comparisons from misclassifying
MariaDB as "newer than MySQL X.Y" when the two version number lines have
diverged. The guard worked while MariaDB stayed in the 10.x line, but
when MariaDB went to 11.x, the function started returning true for
MariaDB 11.4.9 against the MySQL-derived `MinimumChangeReplicationSourceVersion`
({8,0,23}) — so `sandbox/replication.go::replicationCommands` emitted
`CHANGE REPLICATION SOURCE TO` for MariaDB 11.4, which MariaDB doesn't
recognize:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax;
... near 'REPLICATION SOURCE TO source_host="127.0.0.1" ...
`initialize_slaves` then aborted before issuing CHANGE MASTER, slaves
never connected to the primary, and the only users on the slaves were
the bootstrap root account — manifesting at the user level as the
reported `Access denied for user 'msandbox'@'localhost'`.
Extending the guard to `major >= 10` covers MariaDB 11.x (and any future
MariaDB major bumps) until a proper flavor-aware migration of these
call-sites to `common.HasCapability(flavor, feature, version)` is done.
MySQL itself has not shipped a 10.x or 11.x line (current MySQL is 9.x),
so this remains safe in practice.
Verified end-to-end on Ubuntu/x86_64 with the 11.4.9 systemd tarball
from archive.mariadb.org:
before fix:
deploy replication 11.4.9 → initialize_slaves fails silently
slave 'use' → Access denied for user 'msandbox'@'localhost'
after fix:
deploy replication 11.4.9 → CHANGE MASTER TO / START REPLICA succeed
slave 'use' → 1 (auth works)
check_slaves → both slaves at master log position, IO+SQL running
This also touches every other replication path that consulted
`GreaterOrEqualVersion` (multi-source, group, pxc, innodb-cluster,
replication) — all of which were previously skipped for MariaDB 10 and
are now correctly skipped for MariaDB 11+ as well.1 parent ef4ee6c commit 9e188c8
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
673 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
674 | 681 | | |
675 | 682 | | |
676 | 683 | | |
| |||
0 commit comments