Repository navigation
MariaDB 12.3: discovery fails with @@global.read_only scan error ("OFF" into type bool) #120
Description
Bug Report
Orchestrator version
v4.31.1 (official release binary)
Backend
SQLite
Configuration
{
"Debug": true,
"ListenAddress": ":3000",
"MySQLTopologyUser": "orchestrator",
"MySQLTopologyPassword": "REDACTED",
"MySQLTopologySSLSkipVerify": true,
"BackendDB": "sqlite",
"SQLite3DataFile": "/path/to/orchestrator.sqlite3",
"MySQLConnectTimeoutSeconds": 2,
"MySQLConnectionLifetimeSeconds": 300,
"DefaultInstancePort": 3307,
"DiscoverByShowSlaveHosts": true,
"InstancePollSeconds": 5,
"HostnameResolveMethod": "none",
"MySQLHostnameResolveMethod": "none",
"FailureDetectionPeriodBlockMinutes": 1,
"RecoveryPeriodBlockSeconds": 60,
"ApplyMySQLPromotionAfterMasterFailover": true,
"DetachLostSlavesAfterMasterFailover": true
}Topology
N/A - discovery never succeeds, so the instance never registers and no topology exists for it. orchestrator-client -c topology returns nothing for this host.
Steps to reproduce
- Stand up a MariaDB 12.3.x server (tested against 12.3.2, official
mariadb:12.3Docker image) with GTID replication configured. - Point orchestrator at it:
curl -s "http://<orch-host>:3000/api/discover/<mariadb-host>/<port>" - Discovery fails immediately; the instance is never added.
Expected behavior
Instance discovers successfully; @@global.read_only is parsed correctly regardless of whether the server returns it as an integer or a string.
Actual behavior
Discovery fails with:
sql: Scan error on column index 4, name "@@global.read_only": sql/driver: couldn't convert "OFF" into type bool
Root cause: on MariaDB 12.3, @@global.read_only is returned over this driver/connector path as the string 'ON'/'OFF' rather than an integer 0/1, and go/inst/instance_dao.go's ReadTopologyInstanceBufferable scans it directly into a bool field, which fails the type conversion.
Confirmed MariaDB-12.x-specific: 11.8.8, 11.4.12, 10.11.18, and MySQL 8.4.11/9.7.2 all return read_only in a form the driver converts fine; only 12.3.2 exhibits this.
Logs
sql: Scan error on column index 4, name "@@global.read_only": sql/driver: couldn't convert "OFF" into type bool
Additional context
- Reproduced consistently across a full multi-version compatibility sweep (MariaDB 10.11/11.4/11.8/12.3, MySQL 8.4/9.7) using fresh containers each time - only 12.3 fails.
- We have a fix and have verified it end-to-end (discovery + full failover cycle + ProxySQL hostgroup handling) against all 6 versions with zero regressions: casting via
CASE WHEN CAST(@@global.read_only AS CHAR) IN ('1','ON','on') THEN 1 ELSE 0 ENDinstead of scanning the raw value intobool. - Branch:
fix/mariadb-read-only-bool-scan(will open as a PR). - Note: a naive
CAST(@@global.read_only AS UNSIGNED)approach is not safe - under some MariaDB versions/connector paths this silently evaluates the string'ON'to0, which would report a read-only replica as writable. The CASE-WHEN string-match approach avoids this.
Activity
coderabbitai commentedon Aug 11, 2026
🔗 Related PRs
#60 - Fix pre-existing lint issues (partial) [closed]
#75 - Multi-cluster support: MySQL and PostgreSQL simultaneously [closed]
#85 - CI: MySQL version matrix (5.7-9.6) and named channels tests [closed]
#91 - CI: Add behavioral validation tests for topology, problems, and operations [closed]
#108 - fix: prevent false DeadMaster and drain MariaDB relay logs (
#106) [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
renecannao commentedon Aug 11, 2026
Thank you again, @ahmetsoguksu. The detailed report and cross-version investigation made this subtle MariaDB 12.3 compatibility problem straightforward to reproduce and fix.
PR #121 is now merged. We also added MariaDB 12.3 to functional CI and verified read_only=OFF, ON, NO_LOCK, and NO_LOCK_NO_ADMIN; all checks passed.
Closing as resolved. We sincerely appreciate the careful diagnosis, validation, and contribution.