Skip to content

Commit

Permalink
MDEV-27919 mariabackup --log-copy-interval is measured in millisecond…
Browse files Browse the repository at this point in the history
…ss in 10.5 and in microseconds in 10.6

Multiply polling interval by 1000.
  • Loading branch information
vlad-lesin committed Apr 21, 2022
1 parent f0c52bf commit 1b558dd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
8 changes: 8 additions & 0 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/mariabackup/log_copy_interval.result
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions mysql-test/suite/mariabackup/log_copy_interval.test
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 1b558dd

Please sign in to comment.