MariaDB/Galera¶
This page is the starting point for MariaDB/Galera, the mariadb role: the containers mariadb and
mariadb_clustercheck, on the control nodes of the example inventory, selected by the tag mariadb. The lists below
say where the study covers how to operate it, its impact, its dependencies and the evidence, what to check around a run
and what stays open; the service card follows them.
Where to look¶
Operate¶
- Scenario: Change control-plane membership §2
- Command: Database operations, Command quick lookup by tag
Impact and risk¶
- What the tag executes (
mariadb): Tags §3 and Tags §3.1, rowsmariadb - Risks: R9;
mariadb_recovery: R18
Dependencies¶
- Dependencies: Component dependencies §1, Component dependencies §2
Evidence¶
- Fact sheet: fact sheet B §1
- Image side: Kolla images
§4 (row
mariadb), Kolla images §5, Kolla images §5.4 - Also: handlers: Tags §5
Before and after a run¶
- Pre-execution checklist, step 3 (batch size):
ANSIBLE_SERIALcoversreconfigure/upgradeand-e kolla_serial=Ncoversdeploy; mariadb and rabbitmq ignore it. - Pre-execution checklist, step 5 (health gates): before the run, check
Galera:
wsrep_cluster_size,wsrep_local_state_comment=Synced. Repeat after each batch. - Pre-execution checklist, step 8 (rollback material): a MariaDB backup
(
kolla-ansible mariadb_backup). - Tags §3.1, row
mariadb: safe on its own "only on a healthy, fully synced cluster"; prerequisite: every nodeSynced. - R9, precautions for a MariaDB config change or image change: check
wsrep_cluster_sizeandSyncedon all nodes before; take a backup (mariadb_backup); watch between waves. - R18, precautions for
mariadb_recovery: only when the cluster is fully down; identify the node with the highest seqno manually first. - R22, inventory reordering (haproxy, mariadb, glance, nova-conductor, keystone groups): MariaDB restart waves and active backend move. Precautions: treat inventory order as configuration; never reorder casually.
- fact sheet B
§1.8,
item 4 (fail-fast guards): reconfigure aborts if the cluster is fully stopped (multi-node) or any alive node is not
Synced.
kolla-ansible stopstops every node at once, so the next deploy/reconfigure fails untilmariadb_recoveryis run.
Known limits and open points¶
- Known bugs and limitations, row
mariadb: the restart waves have noany_errors_fatal; recovery stops healthy nodes; clustercheck started even when disabled. Status: CODE: a node that fails its WSREP wait marks only its own host failed, and the next wave still restarts its nodes (R9); whether the failed node is then still joining, and how large the quorum and availability risk is, NOT AVAILABLE. - Q6: "MariaDB rolling restart under load with a failure in wave 1: do later waves proceed?" Status: control flow answered from the source CODE: a node that fails its WSREP wait marks only its own host failed, and the next wave still restarts its nodes. NOT AVAILABLE Whether the failed node is then still joining, whether that can leave a single Synced node acting as donor, and so how large the quorum and availability risk is.
- What is not
known, row
"MariaDB": the sources do not establish whether node 0's restart wave runs first; after a failed WSREP wait (the next
wave still restarts its nodes CODE, R9), whether the failed node is then still
joining, whether that can leave a single Synced node acting as donor, and how large the quorum and availability risk
is; nor whether the DB containers come back as a non-primary cluster after a full stop, and whether a manual start
left with
--wsrep-new-clusterbootstraps a new cluster. - What is not known:
the sources do not establish dumb-init signal forwarding for
mysqld_safeunder the MariaDB image's own entrypoint, whether xtrace writes one-shot secrets (the MariaDB root password among them) to the container's stderr, or the cost of the recursive chown on large trees (the MariaDB datadir among them). - fact sheet B §1.8, "Operationally notable behaviour, risks and oddities", eleven items: reconfigure with a galera.cnf change; clustercheck restart is not rolling; WSREP-sync wait is only about 60 s; fail-fast guards; recovery takes the whole cluster down; recovery bug; recovery assumptions; upgrade; backup; credentials on the command line; scale-out restarts the whole cluster.
- Kolla images §6, items 10 and 16: recursive chown on data volumes at every start, the MariaDB datadir among them CODE; MariaDB has no automatic Galera recovery.
- R20: a Glance reconfigure or deploy toggles the global MariaDB
log_bin_trust_function_creators1→0 around db sync.
Service card¶
The rows of the card are explained in How to read a service card.
| Item | Value |
|---|---|
| Play | site.yml:471 |
| Tags | mariadb |
| Play host patterns | mariadb |
| Node types in play (example inventory) | control |
| Node types running its containers | control |
| Containers | mariadb, mariadb_clustercheck |
deploy/reconfigure flow (tasks/) |
config → check-containers → bootstrap → flush handlers → register → check |
| Task files | backup.yml, bootstrap.yml, bootstrap_cluster.yml, check-containers.yml, check.yml, config.yml, deploy-containers.yml, deploy.yml, loadbalancer.yml, lookup_cluster.yml, main.yml, precheck.yml, pull.yml, reconfigure.yml, recover_cluster.yml, register.yml, restart_services.yml, stop.yml, upgrade.yml, wait_for_loadbalancer.yml |
| Templates | backup.my.cnf.j2, galera.cnf.j2, mariabackup.json.j2, mariadb-clustercheck.json.j2, mariadb.json.j2, wsrep-notify.sh.j2, xinetd-clustercheck.j2 |
| Handlers (definition order) | Starting first MariaDB container; Wait for first MariaDB service port liveness; Wait for first MariaDB service to sync WSREP; Creating haproxy mysql user; Restart MariaDB on existing cluster members; Start MariaDB on new nodes; Ensure MariaDB is running normally on bootstrap host; Restart mariadb-clustercheck container |
| Key variables | enable_mariadb, mariadb_*, database_address, enable_external_mariadb_load_balancer |
| Role dependencies | common (meta) |
Related¶
- Database operations — the
mariadb_backupandmariadb_recoverycommand lines - Change control-plane membership — Galera membership changes restart all DB nodes
- Stop and destroy — after
kolla-ansible stop, MariaDB needsmariadb_recovery - HAProxy + Keepalived — the database is reached through the internal VIP and HAProxy
- Pre-execution checklist — the eight checks before every production run
- Components — the other component pages