MDEV-12814 mariabackup : don't try io throttling in copy-back

Throttling only works with when creating backup.  Attempt to use it with
 --copy-back results in crash, since throttle events are not initialized.
Thus, ignore throttling unless --backup is given.
This commit is contained in:
Vladislav Vaintroub 2017-05-16 17:11:25 +00:00
parent f302a3cf9d
commit 40c7778e05
2 changed files with 2 additions and 2 deletions

View File

@ -2169,7 +2169,7 @@ xb_write_delta_metadata(const char *filename, const xb_delta_info_t *info)
void
xtrabackup_io_throttling(void)
{
if (xtrabackup_throttle && (io_ticket--) < 0) {
if (xtrabackup_backup && xtrabackup_throttle && (io_ticket--) < 0) {
os_event_reset(wait_throttle);
os_event_wait(wait_throttle);
}

View File

@ -7,7 +7,7 @@ shutdown_server;
echo # remove datadir;
rmdir $_datadir;
echo # xtrabackup move back;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2 --throttle=1;
echo # restart server;
exec echo "restart" > $_expect_file_name;
enable_reconnect;