Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
Description
The major cases for the --check-if-upgrade-is-needed are:
- MDEV-27606 - debian upgrades, which for historical reasons ran mysql_upgrade to expose new functionality to the user.
MDEV-25670Docker Library should run mariadb_upgrade - a very requested user feature that cannot be achieved in all the normal ways of container interaction.
Because of the current implementation the current Debian implementation would look like:
- Start a temporary server in all the fancy ways to prevent user access, plugin initialization, excessive startup time etc (MDEV-27606 has a more complete list)
- Run mysql_upgrade --check-if-upgrade-is-needed
- If this returns true, probably not as already upgrade, run mysql_upgrade --upgrade-system-tables
- shutdown temporary server
- start real server with configured options
The container implementation would be largely the same.
The rather complicated idea of MDEV-27167 system variable deferred-networking to resolve early initialization, consistent with https://github.com/MariaDB/mariadb-docker/issues/350#issuecomment-786341072 seemed rather unpopular and I was awaiting the MDEV-27279 implementation to be able to resolve this is a scripted manner, preferably as below:
A more ideal scenario is:
- (mariadb server is offline as starting point by default)
- Run mysql_upgrade --check-if-upgrade-is-needed
- if true; start temporary server; run mysql_upgrade; shutdown temporary server
- start real server with configured options
The reasons for the mysql_upgrade to connect to the server are:
- to SELECT VERSION
- to obtain the datadir where mysql_upgrade_info can be examined
To obtain these for the purposes of mysql_upgrade --check-if-upgrade-is-needed without connecting to the server:
- mysql_upgrade has a hard baked server version
- datadir can be a mysql_upgrade option
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 MDEV-25670 as the first double start mechanism is implemented, many users will complain if the Debian packaging/container entry-point is implemented the current way.
Attachments
Issue Links
- is caused by
-
MDEV-27279 mariadb_upgrade add --check-if-upgrade-is-needed / restrict tests to major version
-
- Closed
-
- is part of
-
MDEV-27606 change debian packaging to not run mariadb-upgrade at the same time as anything
-
- Open
-
- relates to
-
MDEV-30499 mariadb in-server upgrade
-
- Open
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue is caused by |
Link |
This issue blocks |
Link | This issue blocks MDEV-27606 [ MDEV-27606 ] |
Assignee | Michael Widenius [ monty ] |
Link |
This issue blocks |
Priority | Major [ 3 ] | Critical [ 2 ] |
Description |
The major cases for the {{--check-if-upgrade-is-needed}} are:
* MDEV-27606 - debian upgrades, which for historical reasons ran mysql_upgrade to expose new functionality to the user. * Because of the current implementation the current Debian implementation would look like: # Start a temporary server in all the fancy ways to prevent user access, plugin initialization, excessive startup time etc (MDEV-27606 has a more complete list) # Run {{mysql_upgrade --check-if-upgrade-is-needed}} # If this returns true, probably not as already upgrade, run {{mysql_upgrade --upgrade-system-tables}} # shutdown temporary server # start real server with configured options The container implementation would be largely the same. The rather complicated idea of MDEV-27167 system variable deferred-networking to resolve early initialization, consistent with https://github.com/MariaDB/mariadb-docker/issues/350#issuecomment-786341072 seemed rather unpopular and I was awaiting the A more ideal scenario is: # (mariadb server is offline as starting point by default) # Run {{mysql_upgrade --check-if-upgrade-is-needed}} # if true; start temporary server; run mysql_upgrade; shutdown temporary server # start real server with configured options The reasons for the mysql_upgrade to connect to the server are: * to {{SELECT VERSION}} * to obtain the datadir where {{mysql_upgrade_info}} can be examined To obtain these for the purposes of {{mysql_upgrade --check-if-upgrade-is-needed}} without connecting to the server: * {{mysql_upgrade}} has a hard baked server version * {{datadir}} can be a {{mysql_upgrade}} option 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 |
The major cases for the {{--check-if-upgrade-is-needed}} are:
* MDEV-27606 - debian upgrades, which for historical reasons ran mysql_upgrade to expose new functionality to the user. * Because of the current implementation the current Debian implementation would look like: # Start a temporary server in all the fancy ways to prevent user access, plugin initialization, excessive startup time etc (MDEV-27606 has a more complete list) # Run {{mysql_upgrade --check-if-upgrade-is-needed}} # If this returns true, probably not as already upgrade, run {{mysql_upgrade --upgrade-system-tables}} # shutdown temporary server # start real server with configured options The container implementation would be largely the same. The rather complicated idea of MDEV-27167 system variable deferred-networking to resolve early initialization, consistent with https://github.com/MariaDB/mariadb-docker/issues/350#issuecomment-786341072 seemed rather unpopular and I was awaiting the A more ideal scenario is: # (mariadb server is offline as starting point by default) # Run {{mysql_upgrade --check-if-upgrade-is-needed}} # if true; start temporary server; run mysql_upgrade; shutdown temporary server # start real server with configured options The reasons for the mysql_upgrade to connect to the server are: * to {{SELECT VERSION}} * to obtain the datadir where {{mysql_upgrade_info}} can be examined To obtain these for the purposes of {{mysql_upgrade --check-if-upgrade-is-needed}} without connecting to the server: * {{mysql_upgrade}} has a hard baked server version * {{datadir}} can be a {{mysql_upgrade}} option 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 |
Link | This issue relates to MDEV-30499 [ MDEV-30499 ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.2 [ 14601 ] |
Remote Link | This issue links to "opensuse bug 1227311 (Web Link)" [ 37082 ] |
Assignee | Michael Widenius [ monty ] | Daniel Black [ danblack ] |
Assignee | Daniel Black [ danblack ] |
Affects Version/s | 10.2(EOL) [ 14601 ] | |
Issue Type | Bug [ 1 ] | New Feature [ 2 ] |
Assignee | Ralf Gebhardt [ ralf.gebhardt@mariadb.com ] |
Link | This issue blocks MDEV-27606 [ MDEV-27606 ] |
Link | This issue is part of MDEV-27606 [ MDEV-27606 ] |
Assignee | Ralf Gebhardt [ ralf.gebhardt@mariadb.com ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Assignee | Daniel Black [ danblack ] |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Labels | foundation |
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.