MDEV-34713 Backup and restore mariadb_upgrade_info file#4605
MDEV-34713 Backup and restore mariadb_upgrade_info file#4605gkodinov merged 1 commit intoMariaDB:mainfrom
Conversation
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution. This is a preliminary review.
Please also sort out the CLA bot! It must say "CLA signed".
gkodinov
left a comment
There was a problem hiding this comment.
Please see some answers to your questions below.
Also please clear the CLA bot!
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your work. I will ignore the CLA bot for now. Please let me know if you have any updates on that.
LGTM. Please stand by for the final review.
There was a problem hiding this comment.
Nope, this idea is wrong. This file should not be created with mariabackup --copy-back with the version of mariabackup. This file should already be in the backup, original, from the MariaDB server, included during mariadb-backup --backup time. It should be correct version exactly how it was on the server, not the one taken from mariabackup on the destination machine.
Look into backup_files_from_datadir to see how it is done for AWS KMS keys (that's from key management plugin we do not distibute anymore), aria_log, and something from mroonga.
vuvova
left a comment
There was a problem hiding this comment.
changing the review status to reflect @vaintroub's comment
vaintroub
left a comment
There was a problem hiding this comment.
That looks good. My only comment is that the file mariadb_upgrade_info that was created in the datadir during the test, and now was proven to survive backup, restore and moveback, needs to be removed again, at the end of the test.
|
@vaintroub thank you for all the feedback! |
|
@gkodinov thank you for the approval. Looks like the only test that is failing now is |
The mariadb_upgrade_info file was not being backed up during mariadb-backup --backup, causing MariaDB to incorrectly prompt for upgrade after restore. Add mariadb_upgrade_info to the list of files backed up from the datadir during backup operations, ensuring the upgrade state is preserved across backup and restore cycles. All new code of the whole pull request, including one or several files that are 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.
yes, vector is unrelated. |
Description
The
mariadb_upgrade_infofile was not being backed up during mariadb-backup--backupoperations, causing MariaDB to incorrectly prompt for an upgrade even when restoring from a backup of the same version.Without this file being preserved in the backup, mariadb-upgrade cannot determine the database version after restore and assumes an upgrade is needed, forcing users to run unnecessary upgrade operations during disaster recovery.
Add
mariadb_upgrade_infoto the list of files backed up from the datadir during backup operations, ensuring the upgrade state is preserved across backup and restore cycles.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.