xtrabackup_logfile written to incremental backup

When following the instructions at http:// www.percona.com/docs/wiki/percona-xtrabackup:xtrabackup:incr emental#preparing_the_backups for restoring incremental backups, I’ve noticed that each time I apply an incremental backup to the base, xtrabackup_51 writes a file called “xtrabackup_logfile” into the incremental backup directory, replacing the one that’s already there.

The trouble is I’m trying to keep my base and incremental backups pristine during restore (by copying the base backup and applying the incremental backups to the copy). This seems to cause future restores using the same sources to fail, because the incremental backups have been modified by a previous restore. Is this behavior a bug? I suppose I could make a copy of each incremental backup before applying it to the copy of the base, but this will add some complexity to the restore script we’ve developed. Any ideas?

If I try to restore an incremental backup that has already been restored and has had a new xtrabackup_logfile written to it, I get the following error:

xtrabackup: ########################################################
xtrabackup: # !!WARNING!! #
xtrabackup: # The transaction log file should be wrong or corrupt. #
xtrabackup: # The log was not applied to the intended LSN! #
xtrabackup: ########################################################
xtrabackup: The intended lsn is 0:52577580

However, xtrabackup seems to still exit with 0 in this case, so the calling script is not able to detect the problem without grepping (which is a pain in this particular case).

This looks like a bug; please report it at launchpad project percona-xtrabackup.