MDEV-21037 mariabackup does not detect multi-source replication slave

This commit is contained in:
Alexander Barkov 2022-04-18 19:43:25 +04:00
commit 907e4c62ce
7 changed files with 510 additions and 79 deletions

View file

@ -0,0 +1,14 @@
--disable_query_log
--file_exists $targetdir/xtrabackup_slave_info
CREATE TEMPORARY TABLE tmp_slave_info(lineno SERIAL, line TEXT);
--replace_result $targetdir TARGETDIR
--eval LOAD DATA LOCAL INFILE '$targetdir/xtrabackup_slave_info' INTO TABLE tmp_slave_info (line);
SELECT
lineno,
regexp_replace(
regexp_replace(line, '(?<=MASTER_LOG_POS=)[0-9]+', '<NUM>'),
'[0-9]+-[0-9]+-[0-9]+', '<NUM-NUM-NUM>')
AS line
FROM tmp_slave_info ORDER BY lineno;
DROP TEMPORARY TABLE tmp_slave_info;
--enable_query_log

View file

@ -0,0 +1,20 @@
--disable_query_log
--file_exists $XTRABACKUP_OUT
CREATE TEMPORARY TABLE tmp_slave_info_out(lineno SERIAL, line TEXT);
--replace_result $targetdir TARGETDIR
--eval LOAD DATA LOCAL INFILE '$XTRABACKUP_OUT' INTO TABLE tmp_slave_info_out (line);
SELECT
replace(
regexp_replace(
regexp_replace(line,
'[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]',
'YYYY-MM-DD hh:mm:ss'),
'[0-9]+-[0-9]+-[0-9]+', '<NUM-NUM-NUM>'),
'\r','' /* Remove CR on Windows */)
AS line
FROM tmp_slave_info_out
WHERE line LIKE '%MySQL slave binlog position%'
OR line LIKE '%Failed to get master binlog coordinates%'
ORDER BY lineno;
DROP TEMPORARY TABLE tmp_slave_info_out;
--enable_query_log