diff options
author | Vlad Lesin <vlad_lesin@mail.ru> | 2022-04-15 18:21:54 +0300 |
---|---|---|
committer | Vlad Lesin <vlad_lesin@mail.ru> | 2022-04-21 15:24:59 +0300 |
commit | 1b558dd462d34e948f3a4d9e54af973e37a9746e (patch) | |
tree | 4917e4a65e7ddf80ff0482e417a8bd46f9803015 | |
parent | f0c52bfe3bc0ffe4063e0572dd2cfd7148cf955e (diff) | |
download | mariadb-git-1b558dd462d34e948f3a4d9e54af973e37a9746e.tar.gz |
MDEV-27919 mariabackup --log-copy-interval is measured in millisecondss in 10.5 and in microseconds in 10.6
Multiply polling interval by 1000.
-rw-r--r-- | extra/mariabackup/backup_copy.cc | 8 | ||||
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 2 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/log_copy_interval.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/log_copy_interval.test | 18 |
4 files changed, 29 insertions, 1 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index ff2ff5bfc4a..ce94ef5864d 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -55,6 +55,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA #include "xtrabackup.h" #include "common.h" #include "backup_copy.h" +#include "backup_debug.h" #include "backup_mysql.h" #include <btr0btr.h> @@ -1443,6 +1444,13 @@ bool backup_start(CorruptedPages &corrupted_pages) msg("Waiting for log copy thread to read lsn %llu", (ulonglong)server_lsn_after_lock); backup_wait_for_lsn(server_lsn_after_lock); + DBUG_EXECUTE_FOR_KEY("sleep_after_waiting_for_lsn", {}, + { + ulong milliseconds = strtoul(dbug_val, NULL, 10); + msg("sleep_after_waiting_for_lsn"); + my_sleep(milliseconds*1000UL); + }); + backup_fix_ddl(corrupted_pages); // There is no need to stop slave thread before coping non-Innodb data when diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 4f7dde67c67..e30541c7b4e 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -3098,7 +3098,7 @@ static void log_copying_thread() (!metadata_to_lsn || metadata_to_lsn > log_copy_scanned_lsn)) { timespec abstime; - set_timespec_nsec(abstime, 1000ULL * xtrabackup_log_copy_interval); + set_timespec_nsec(abstime, 1000000ULL * xtrabackup_log_copy_interval); mysql_cond_timedwait(&log_copying_stop, &log_sys.mutex, &abstime); } log_copying_running= false; diff --git a/mysql-test/suite/mariabackup/log_copy_interval.result b/mysql-test/suite/mariabackup/log_copy_interval.result new file mode 100644 index 00000000000..678fc6cc0a2 --- /dev/null +++ b/mysql-test/suite/mariabackup/log_copy_interval.result @@ -0,0 +1,2 @@ +# xtrabackup backup +NOT FOUND /sleep_after_waiting_for_lsn\n(\[\d+\] \d+-\d+-\d+ \d+:\d+:\d+ >> log scanned up to \(\d+\)\n){2}/ in backup.log diff --git a/mysql-test/suite/mariabackup/log_copy_interval.test b/mysql-test/suite/mariabackup/log_copy_interval.test new file mode 100644 index 00000000000..5ea09c53066 --- /dev/null +++ b/mysql-test/suite/mariabackup/log_copy_interval.test @@ -0,0 +1,18 @@ +--source include/have_debug.inc + +echo # xtrabackup backup; +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; +--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log + +--let sleep_after_waiting_for_lsn=250 +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --log-copy-interval=500 --dbug=+d,mariabackup_inject_code > $backup_log 2>&1; +--enable_result_log + +--let SEARCH_PATTERN=sleep_after_waiting_for_lsn\n(\[\d+\] \d+-\d+-\d+ \d+:\d+:\d+ >> log scanned up to \(\d+\)\n){2} +--let SEARCH_FILE=$backup_log +--source include/search_pattern_in_file.inc +--remove_file $backup_log + +rmdir $targetdir; + |