[MDEV-27636] mariadb_upgrade --check-if-upgrade-is-needed cannot be run offline Created: 2022-01-27 Updated: 2023-12-11 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Daniel Black | Assignee: | Michael Widenius |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
The major cases for the --check-if-upgrade-is-needed are:
Because of the current implementation the current Debian implementation would look like:
The container implementation would be largely the same. The rather complicated idea of A more ideal scenario is:
The reasons for the mysql_upgrade to connect to the server are:
To obtain these for the purposes of mysql_upgrade --check-if-upgrade-is-needed without connecting to the server:
While there is no 100% certainty that the mysql_upgrade version is the same as the mariadbd server version when connected, it always will be in the container (one version per container) and most likely in the Debian installation. Miss-use of mysql_upgrade from different server versions at the check stage can rely on the real upgrade version check to be more thorough. Even if the --check-if-upgrade-is-need from a 10.2 is run and returns a incorrect result because the server version is 10.1, the version of the server is still checked with the mysql_upgrade is properly run (unless --skip-force is specified). So lets re-implement mysql_upgrade --check-if-upgrade-is-needed to have a datadir option and run in an offline mode. This will prevent two mariadb server starts on every time systemd/sysv init/container entrypoint starts and account for the common of an upgrade already occurred, knowing there's a small chance of incorrect versions mismatch, and knowing the fall back version check is there. While this doesn't strictly block MDEV-27606 or |
| Comments |
| Comment by Daniel Black [ 2022-01-28 ] |
I totally agree with the above, the actions of mysql_upgrade when its actually doing the upgrade need to do all the strict version/datadir checks. Just not with --check-if-upgrade-is-needed as a quick check which will almost never encounter these problems, and even if it did, it would be the responsibly of actually doing the upgrade to check it strictly. |