Uploaded image for project: 'Percona XtraBackup'
  1. Percona XtraBackup
  2. PXB-752

LP #1557027: Error message about missing metadata is misleading

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      **Reported in Launchpad by Valerii Kravchuk last update 13-02-2017 09:03:27

      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.

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              lpjirasync lpjirasync (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: