[MDEV-12576] Upgrade MariaDB 10.0 from Distro to 10.1 from MariaDB Repo does not happen Created: 2017-04-24 Updated: 2021-03-02 Resolved: 2021-03-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.0.21, 10.1.22 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Oli Sennhauser | Assignee: | Daniel Black |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian 8 (Jessie) and OpenSuSE 13.2 |
||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
We had in a MariaDB Training Standard Linux distros with standard MariaDB Installations and wanted to upgrade to the newest MariaDB 10.1 from MariaDB repository. We later found out because of an error in journalcontrol that an upgrade from the DD never happened:
we have the opinion that during upgrade MariaDB package should: a) either upgrade with mysql_upgrade directly or Regards, |
| Comments |
| Comment by Elena Stepanova [ 2017-05-02 ] | ||||||||||||||||||||||||||||||||||||||||
|
You mentioned both Debian and openSUSE, which one was it that you experienced the problem on? They are essentially different in regard to mysql_upgrade. As I understand, both Debian Jessie and openSUSE 13.2 have MariaDB 10.0. Are you getting this error every time you start the server, or did you get it only once? | ||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2017-05-02 ] | ||||||||||||||||||||||||||||||||||||||||
|
It happened on both, Debian and openSuSE. Correct. Both started with Distro MariaDB 10.0. Then they added the MariaDB repo and did a zypper/apt-get update/upgrade as far as I have seen. Then we found the error message in the MariaDB error log. And as far as I can tell the problem was not solved after a DB restart. So we had to do mysql_upgrade ourself. So pretty straight forward. You use the distro version. Then you want to go to a newer version. Nothing exotic. So the question is: Should a package post_install script upgrade the database or not... | ||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-05-02 ] | ||||||||||||||||||||||||||||||||||||||||
|
It's not really as straight-forward as it seems. Debian upgrade 10.0 => 10.1 is indeed supposed to work and among other things run mysql_upgrade, at least in packages produced by MariaDB. I'll check what's happening there. But on RPM-based systems we generally don't support major upgrade (such as 10.0 => 10.1). It's meant to be changed, and there is a task for that, but it's not in the main trees yet. Usually it will just refuse to run the upgrade and say that manual intervention is required. Also, since it is not expected to do major upgrade, it does not run mysql_upgrade automatically either. Maybe there are exceptions, particularly with zypper, when it decides it can upgrade after all, but still does not run mysql_upgrade, I will take a look. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-05-12 ] | ||||||||||||||||||||||||||||||||||||||||
|
Tried openSUSE. It was a bit cumbersome, since openSUSE 13 is already EOL-ed, so maybe my experiment wasn't clean enough. Expectedly, zypper update didn't work, it said
When I uninstalled 10.0 and installed 10.1 – also expectedly, install didn't run mysql_upgrade, since it's a "manual upgrade" anyway. Running it manually made the error go away. I'll try Debian next, it is more interesting. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-05-12 ] | ||||||||||||||||||||||||||||||||||||||||
|
Indeed, on Debian packages get upgrade to 10.1/10.2, but don't run mysql_upgrade (at least MariaDB's packages). 10.0 ran mysql_upgrade. I assume it's a part of otto's changes in 10.1. Otto, was it intentional that mysql_upgrade does not run upon upgrade anymore? | ||||||||||||||||||||||||||||||||||||||||
| Comment by Ondřej Surý (Inactive) [ 2017-05-13 ] | ||||||||||||||||||||||||||||||||||||||||
|
mysql_upgrade is called after starting the safe_mysqld in both sysvrc and sysvinit scripts. But running this after starting the mysqld for users creates a race condition that existed there for a long time. E.g. when testing, the mysql_upgrade is not running as a part of the upgrade, but as part of the startup script. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Ondřej Surý (Inactive) [ 2017-05-13 ] | ||||||||||||||||||||||||||||||||||||||||
|
JFTR the downstream Debian packages (10.1.23-7) run mysql_upgrade: with added set -x set +x around upgrade_system_tables_if_necessary call
| ||||||||||||||||||||||||||||||||||||||||
| Comment by Ondřej Surý (Inactive) [ 2017-05-13 ] | ||||||||||||||||||||||||||||||||||||||||
|
I can't test upgrade path with systemd, but on Debian jessie upgrading from 10.0 to 10.1 works as expected:
oli How big were the tables during the training that got upgraded? E.g. how long did the manual mysql_upgrade run took? | ||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-05-14 ] | ||||||||||||||||||||||||||||||||||||||||
|
Here is the opposite complaint about 10.0: In general, this discussion has been back and forth for long time, either decision has its disadvantages. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Faustin Lammler [ 2018-09-24 ] | ||||||||||||||||||||||||||||||||||||||||
|
Hi elenst, I think this is clearly linked to what you are describing: | ||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-09-27 ] | ||||||||||||||||||||||||||||||||||||||||
|
elenst, I'd optimize for a common use case. And that's a user who doesn't have a huge amount of data or high concurrent load, and is not MariaDB expert. That means, automatically run mysql_upgrade during upgrade. I'd even say — run mysql_upgrade during upgrade if mysqld is up. So MariaDB experts can stop mysqld for the duration of the upgrade and that'll disable auto-mysql_upgrade too. Or there could be an option somewhere in /etc/mysql/? faust, what do you think? | ||||||||||||||||||||||||||||||||||||||||
| Comment by Faustin Lammler [ 2018-09-29 ] | ||||||||||||||||||||||||||||||||||||||||
|
serg if possible (and compatible with OS upgrade guidelines) I think we should always ask users what we should do (expert or not). For me, message should contain the following:
Expert users can always bypass these interaction with specific apt-get option (for example '--force-yes') if they perfectly know what they are doing. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-03-02 ] | ||||||||||||||||||||||||||||||||||||||||
|
Missed finding this when I created |