Error message about missing metadata is misleading
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_
xtrabackup: error: xtrabackup_
xtrabackup: This target seems not to have correct metadata...
The code is like this in xtrabackup_
6667 if (!xtrabackup_
6668 msg("xtrabackup: error: xtrabackup_
6669
6670 if (!innobase_
6671 {
6672 if (!strcmp(
6673 msg("xtrabackup: This target seems to be not prepar ed "
6674 "yet.\n");
6675 } else if (!strcmp(
6676 msg("xtrabackup: This target seems to be already "
6677 "prepared with --apply-
6678 goto skip_check;
6679 } else if (!strcmp(
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_
https:/
https:/
...
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.
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? checkpoints is missing? Maybe should look into fixing it?
2. Were you able to prepare the backup correctly without metadata file?
3. How often do you see that xtrabackup_
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.