Error message about missing metadata is misleading

Bug #1557027 reported by Valerii Kravchuk
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Status tracked in 2.4
2.3
Fix Released
Medium
Sergei Glushchenko
2.4
Fix Released
Medium
Sergei Glushchenko

Bug Description

xtrabackup sometimes outputs the following to the error log:

xtrabackup: Error: cannot open ./xtrabackup_checkpoints
xtrabackup: error: xtrabackup_read_metadata()
xtrabackup: This target seems not to have correct metadata...

The code is like this in xtrabackup_prepare_func() in 2.4:

6667 if (!xtrabackup_read_metadata(metadata_path))
6668 msg("xtrabackup: error: xtrabackup_read_metadata()\n");
6669
6670 if (!innobase_log_arch_dir)
6671 {
6672 if (!strcmp(metadata_type, "full-backuped")) {
6673 msg("xtrabackup: This target seems to be not prepar ed "
6674 "yet.\n");
6675 } else if (!strcmp(metadata_type, "log-applied")) {
6676 msg("xtrabackup: This target seems to be already "
6677 "prepared with --apply-log-only.\n");
6678 goto skip_check;
6679 } else if (!strcmp(metadata_type, "full-prepared")) {
6680 msg("xtrabackup: This target seems to be already "
6681 "prepared.\n");
6682 } else {
6683 msg("xtrabackup: This target seems not to have correct "
6684 "metadata...\n");
6685 }

So, we state there was an "Error" (and without metadata we can not be sure if the target is prepared, and it's also almost useless for further incremental backups etc), but function just continues after writing these error messages to the log.

Usually where xtrabackup_checkpoints file is missing, the backup is incomplete/broken/affected by some bug/has wrong permissions and is most likely unusable. See the following related bug reports:

https://bugs.launchpad.net/percona-xtrabackup/+bug/1444255
https://bugs.launchpad.net/percona-xtrabackup/+bug/1467598
...

In some cases the backup may still be usable even if this file is missing, maybe that's why prepare stage continues.

I think we should stop by default when metadata are missing and continue only if some explicit --force option is added.

We should also add more detailed error message in this case, explaining what this may mean for further use of the backup when we continue.

If, for some reason, it;'s considered to be always safe to continue prepare without metadata read successfully, then I'd prefer to see "Warning" instead of "Error" and "error" in the messages above.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Hi Valerii,

So, to make the case more clear I want to ask few questions.

1. Why the metadata was missing in your specific case?
2. Were you able to prepare the backup correctly without metadata file?
3. How often do you see that xtrabackup_checkpoints is missing? Maybe should look into fixing it?

In general, nothing bad could happen if we run --prepare twice or even more times. Bad things could happen if we will try to apply incremental on top of the fully prepared backup. So, the backup without metadata file should be used at your own risk. I would make this error critical and stop preparation of the backup.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-752

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.