MDEV-34713 Backup and restore mariadb_upgrade_info file

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.
This commit is contained in:
Fariha Shaikh 2026-01-30 00:59:45 +00:00 committed by Georgi Kodinov
commit 3a2f8e2798
4 changed files with 64 additions and 0 deletions

View file

@ -1519,6 +1519,9 @@ ibx_copy_incremental_over_full()
!(ret = backup_files_from_datadir(ds_data,
xtrabackup_incremental_dir,
"aria_log")) ||
!(ret = backup_files_from_datadir(ds_data,
xtrabackup_incremental_dir,
"mariadb_upgrade_info")) ||
!(ret = backup_mroonga_files_from_datadir(ds_data,
xtrabackup_incremental_dir)))
goto cleanup;

View file

@ -5379,6 +5379,13 @@ class BackupStages {
return false;
}
if (!backup_files_from_datadir(backup_datasinks.m_data,
fil_path_to_mysql_datadir,
"mariadb_upgrade_info")) {
msg("Error on root data dir files backup");
return false;
}
if (has_rocksdb_plugin()) {
rocksdb_create_checkpoint();
}