MDEV-34713 Create mariadb_upgrade_info during mariadb-backup --copy-back #4605
+38
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
mariadb-backup --copy-backoperation was not creating themariadb_upgrade_infofile in the restored datadir, causing MariaDB to incorrectly prompt for an upgrade even when restoring from a backup of the same version.Without this file,
mariadb-upgradecannot determine the database version and assumes an upgrade is needed, forcing users to run unnecessary upgrade operations during disaster recovery.This fix creates the
mariadb_upgrade_infofile with the server version string (MYSQL_SERVER_VERSION) after a successful--copy-backoperation, ensuringmariadb-upgradecorrectly recognizes the database is already at the current version.Release Notes
N/A
How can this PR be tested?
Execute the
mariabackup.full_backuptest inmysql-test-run. This commit adds a test in this file that verifies the creation ofmariadb_upgrade_infoduring a successful copy-back.Before the fix
After the fix
Basing the PR against the correct MariaDB version
Copyright
All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.