Separate the client binary and engine flavour from the service name - #607
Closed
mcowser-p wants to merge 1 commit into
Closed
Separate the client binary and engine flavour from the service name#607mcowser-p wants to merge 1 commit into
mcowser-p wants to merge 1 commit into
Conversation
mysql_daemon has meant three things at once: the systemd unit, the client
binary, and the engine flavour. That is coherent wherever the three share a
name -- MariaDB everywhere, and MySQL on Debian, where the unit really is
`mysql`.
It is not coherent for MySQL on Enterprise Linux, where the unit is `mysqld`
and the client is `mysql`. No single value works:
mariadb wrong on all three. It is the EL default, so a host running real
MySQL fails at `mariadb --version` with "Error executing command"
mysqld correct unit, but runs the SERVER binary with client flags --
`mysqld -NBe "DELETE FROM mysql.user ..."` sits for 100 seconds
trying to start a database, then exits 1 -- and matches neither
flavour test, since those compare against 'mysql' and 'mariadb'
mysql correct client and flavour, wrong unit
Adds mysql_client and mysql_flavour, both defaulting to mysql_daemon, so
every existing playbook is unaffected. secure-installation.yml now invokes
mysql_client for its six client calls and compares mysql_flavour in its
seven engine tests; configure.yml uses mysql_client for --version.
Set the new variables only where the three genuinely differ:
mysql_daemon: mysqld
mysql_client: mysql
mysql_flavour: mysql
Found running MySQL 8.0 on AlmaLinux 9 and 8.4 on Ubuntu 26.04 in a
disaster-recovery lab. The Debian side never surfaces it, which is why it
has stayed hidden: there, one value happens to satisfy all three roles.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
|
Closing — I opened this prematurely. Keeping the change on a private fork for now; will resubmit if it's useful upstream later. Apologies for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Enterprise Linux running real MySQL (not MariaDB), this role cannot complete: the systemd unit is
mysqldwhile the client binary ismysql, andmysql_daemonhas to be both at once.The three meanings
mysql_daemonis currently used as:service: name={{ mysql_daemon }}secure-installation.yml:25,command: {{ mysql_daemon }} -NBe "..."(six call sites)mysql_daemon == 'mariadb'/== 'mysql'(seven tests)That is coherent wherever the three share a name: MariaDB everywhere, and MySQL on Debian, where the unit really is
mysql. On EL + MySQL there is no value that works:mariadb(EL default)mysqldmysqlThe
mysqldcase is the unpleasant one:mysqld -NBe "DELETE FROM mysql.user ..."tries to start a database with client arguments, blocks for ~100 seconds, then exits 1.The change
Adds
mysql_clientandmysql_flavour, both defaulting tomysql_daemon, so every existing playbook is unaffected. Client invocations usemysql_client; flavour comparisons usemysql_flavour.Callers who need the split set it explicitly:
Testing
Found and verified running MySQL 8.0.46 on AlmaLinux 9 and MySQL 8.4 on Ubuntu 26.04. With the change, a host that had failed at
mariadb --versionon every run now completes the role cleanly. Debian is unaffected either way, which is why this has stayed hidden.🤖 Generated with Claude Code