by ocdtrekkie · 8y ago · 0 comments
I was working on script that builds a LEMP stack with Vagrant on a Debian box. And when the script was upgraded to use Debian Stretch, everything we did to customize MySQL configuration broke, and I spent many hours of anguish not knowing why.
Until I stumbled onto the fact that Debian decided that in version 9, they'd start installing MariaDB when you typed "apt-get install mysql-server". I cannot fully explain the anger I have for this dark pattern: When I say "install x", you should either install x or say you don't have it, not install a competitor you think is close enough.
We wanted to maintain both MySQL and MariaDB in Debian stable. However the Debian release team forced the removal of MySQL on the basis that MariaDB only would suffice. We disagreed with this but they overruled us.
mysql-server in Debian stable became a transitional package in Debian stable (only; this doesn't affect testing or unstable) in order to make the upgrade work correctly. It does force users with MySQL server to crossgrade to MariaDB server, and does lead to "mysql-server" being a misnomer in Debian stable.
"default-mysql-server" being MariaDB is also misleading, IMHO, but it's the best we could come up with because there isn't any other collective term that covers both MySQL and MariaDB.
We didn't want this, but it was forced upon us by the Debian release team. Sorry for the trouble. As others have said, we did our best to explain this in the release notes.
We continue to maintain both MySQL and MariaDB in Debian unstable, which remains free of this mess.
Oracle is litigious. This seems to be deep into "poke the bear" territory.
If I could still edit the comment, I would revise "burning white hot rage I have for Debian" to "burning white hot rage I have for the Debian release team". Alas I cannot. :(
Debian, as a project, appointed the release team and granted them the authority to make this decision. Therefore, IMHO, it's perfectly fair to attribute "Debian" to the decision. As long as you understand that it's not the Debian MySQL/MariaDB maintainers :)
I guess the fact that mariadb now owns the "mysql-server" package name is a side-effect of how apt manages upgrades and migrations. It's probably the best way to ensure existing users end up with a supported mysql-ish server after the upgrade, instead of being silently stranded on an obsolete debian8 package without receiving security updates.
mysql-server doesn't belong to MariaDB, they can't "own" it. Doesn't Oracle hold a trademark on it?
Whereas Windows apps tend to standalone, bringing with them any libraries they need, Debian tends to have one copy of each library, runtime, and so on. If you upgrade Debian, you upgrade way more than just the kernel, the gnu tools etc. You also upgrade, for example, the Python, the windowing system, the networking stack. Apps that rely on these must also be upgraded in order to work with the new versions of whatever other packages they rely on.
It’s a domino effect and it keeps on knocking right up to GIMP or, in this case, MySQL.
My answer doesn’t explain why this particular choice was made but I hope it shows how Debian can do that sort of thing whereas Windows wouldn’t.
These situations are rare, but it's not without precedent.
If I run "apt-get install mysql-server" and get something other than MySQL, we now have a trust issue: The Debian repository cannot be trusted.
mysql-server package installs mariadb so that they can handle upgrades gracefully in a way that won't leave existing users in cold.
They would choose to do it the way you said but then the people who are upgrading their systems would be annoyed instead of you. Tough choice but either way it's a minor annoyance to be honest.
Addition:
Also it's not as if it isn't very clear what you're installing:
$ apt install mysql-server
....
The following NEW packages will be installed:
default-mysql-server galera-3 libdbd-mysql-perl libhtml-template-perl libterm-readkey-perl mariadb-client-10.1
mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-server
....
$ man mysql
MYSQL(1) MariaDB Database System MYSQL(1)
NAME
mysql - the MariaDB command-line tool
....
It is not aim of distribution maintainers to hide facts or make you use counterfeit programs, they just want to help users with transition.I certainly disagree that this qualifies as "very clear". The user asked to have mysql installed and the very first item on the list of stuff-to-be-installed is called "default-mysql-server". That certainly sounds like positive confirmation that you are indeed getting what you asked for.
Now, if you keep reading, you will see "mariadb-server-10.1" and stuff on that list, and if you also know two pieces of information (that mariadb is a fork of mysql, and that someone at Debian contemplated the idea of substituting one for the other), then you can see that you may have concluded the wrong thing and you can backtrack from there. Though really, at this point you still have conflicting information and it isn't conclusive.
So, I wouldn't say "very clear" is accurate. More like "possible to decipher if you have all the relevant context and are paying close attention".
As UIs go, this definitely violates the principle of least astonishment.
If Debian doesn't have a piece of software, it shouldn't update it. It should leave it alone.
(And bear in mind, I was working from a script, so unless I sit there reading every line while it builds the VM, all of this unauthorized breakage of my machine is silent and without consulting me.)
And of course, the response to "man mysql" makes no sense, because MariaDB is not MySQL.
It was allowed to stay in unstable:
https://packages.debian.org/sid/mysql-server-5.5
However, the maintainers are uninterested in maintaining it there, since the release and security team have overrode them and forcibly removed it from stable.
Transitional packages are a source of confusion that are never fun, but this still sounds usually harrowing for dealing with the bumps of upgrading servers to a new OS major version. Just how rushed and close to the wire was your deployment?
Installing software that was not authorized on someone's machine is a serious security compromise.
[1]: https://apps.fedoraproject.org/packages/community-mysql [2]: https://apps.fedoraproject.org/packages/mariadb
You could argue this was inevitable, but it was a product of the conditions at the time.
Percona has been a much better citizen with its fork.
Mariadb probably put in for the package name, tbh I can't be bothered to go find out, but I'd bet anything debian team didn't just arbitrarily make that call for users and ship it. 100% guarantee that.
I know your feeling though, that's the sort of thing that should be printing a warning or something when it happens.
In "Stretch", the default MySQL variant is now MariaDB. The replacement of packages for MySQL 5.5 or 5.6 by the MariaDB 10.1 variant will happen automatically upon upgrade.
Seems to me this is a non issue then.
I guess not everybody reads those, and I've already conceded that its something that ought to warrant a warning prompt or something.
But they didn't just change it for no reason.
$ mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 32
Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
$ mysql --version
mysql Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (i686) using readline 5.2
It is pretty clear to anybody ever run the tool that it is MariaDB.