[MDEV-27606] change debian packaging to not run mariadb-upgrade at the same time as anything Created: 2022-01-25 Updated: 2023-11-28 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Packaging |
| Affects Version/s: | None |
| Fix Version/s: | 10.5 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Daniel Black | Assignee: | Faustin Lammler |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Spider, CS and potentially other plugins install udf functions, stored functions and stored procedures. The mysql_upgrade is changes the format of mysql.func, proc and other system tables related to those operations. Evidenced by:
Including but not limited to:
A solution part of packaging might look like: mysql_upgrade --check-if-upgrade-is-needed followed by a temporary start of the server (additional options - https://jira.mariadb.org/browse/MDEV-27068?focusedCommentId=207708&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-207708), maybe put these in a [mariadb.upgrade] group the in the configuration file and use --defaults-group-suffix=.upgrade. followed by mysql_upgrade --upgrade-system-tables |
| Comments |
| Comment by Daniel Black [ 2022-01-26 ] | ||||||||||||||||||||||||
|
note that the temporary start of the server needs to prevent plugin initialization. Scenario: MariaDB 10.2 installed.Then 10.3 installed with spider (e.g) package as well. Like all plugins a plugin-load-add option in a configuration file is dropped and will auto-install on startup. From https://mariadb.com/kb/en/install-plugin/ is appears skip-grant-tables isn't sufficient to prevent it loading. plugin_dir=/dev/null maybe. | ||||||||||||||||||||||||
| Comment by Michael Widenius [ 2022-01-27 ] | ||||||||||||||||||||||||
|
Please update the Description why we have to run mysql_upgrade BEFORE we install spider (or other plugins). It would good if an Description starts with describing the problem and then updated with all the possible solutions for it. | ||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2022-02-18 ] | ||||||||||||||||||||||||
|
The title and description of this issue is wrong/misleading. Debian maintainer scripts (postinstall/preinstall) do not run mariadb-upgrade nor mysql_upgrade. All the references to those commands are inside comments or in reference to temporary data directory /var/lib/mysql-upgrade. The Debian packaging does not call mariadb-upgrade.
The only thing that runs the upgrade is the startup scripts (systemd or init.d) which are largely inherited from how the server upstream wants to be started, and there is no Debian specific thing to fix about mariadb-upgrade. | ||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-02-22 ] | ||||||||||||||||||||||||
|
mysql_upgrade or mariadb-upgrade is run from debian/additions/debian-start.inc.sh included into debian/additions/debian-start, which in turn is run from debian/mariadb-server-10.8.mariadb.init. Which was the source of the original problem (you'll see it if you walk the issue links up) — on every mariadb startup, debian runs mysql_upgrade in the background in parallel with any other user load. This was causing deadlocks and unpredictable results. That's why the issue subject is "not run mariadb-upgrade at the same time as anything" rpm packages do not run mysql_upgrade or mariadb-upgrade at all, so this is very much debian-specifc issue. rpm packages aren't perfect — not running mariadb-upgrade is also bad, but differently. |