Comment 1 for bug 1470847

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

This is easy to confirm with code review. Main backup function, xtrabackup_backup_func, is declared void:

openxs@ao756:~/git/percona-xtrabackup$ grep -rn xtrabackup_backup_func *
storage/innobase/xtrabackup/src/xtrabackup.cc:3278:xtrabackup_backup_func(void)
storage/innobase/xtrabackup/src/xtrabackup.cc:6367: xtrabackup_backup_func();

and ends up like this:

...
   3736 msg("xtrabackup: Transaction log of lsn (" LSN_PF ") to (" LSN_PF
   3737 ") was copied.\n", checkpoint_lsn_start, log_copy_scanned_lsn);
   3738 xb_filters_free();
   3739
   3740 xb_data_files_close();
   3741 }

It is used like this:

   6365 /* --backup */
   6366 if (xtrabackup_backup)
   6367 xtrabackup_backup_func();
   6368
   6369 /* --stats */
   6370 if (xtrabackup_stats)
   6371 xtrabackup_stats_func();
   6372
   6373 /* --prepare */
   6374 if (xtrabackup_prepare)
   6375 xtrabackup_prepare_func();
   6376
   6377 xb_regex_end();
   6378
   6379 exit(EXIT_SUCCESS);

So, there are no checks of checkpoint_lsn_start value vs log_copy_scanned_lsn value and if this function is used and was executed, xtrabackup process just exits with success, no matter what happens. innobackupex script then has no way to find out there was a problem:

if ( $ibbackup_exit_code == 0 ) {
   # program has completed successfully
   print STDERR "$now $prefix completed OK!\n";
}
else {
   print STDERR "$now $prefix $option_ibbackup_binary failed! (exit code $ibbackup_exit_code) The backup may not be complete.\n";
}