Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d7c6d306
Commit
d7c6d306
authored
Dec 08, 2023
by
Yuchen Pei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.4' into 10.5
parents
d5a6ea36
9be7e03f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
mysql-test/main/rpl_mysqldump_slave.result
mysql-test/main/rpl_mysqldump_slave.result
+7
-0
mysql-test/main/rpl_mysqldump_slave.test
mysql-test/main/rpl_mysqldump_slave.test
+31
-1
No files found.
mysql-test/main/rpl_mysqldump_slave.result
View file @
d7c6d306
...
...
@@ -72,6 +72,13 @@ id int
insert into t values (1);
insert into t values (2);
drop table t;
connection slave;
include/stop_slave.inc
change master to master_use_gtid=slave_pos;
connection master;
# Ensuring the binlog dump thread is killed on primary...
-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000002', MASTER_LOG_POS=BINLOG_START;
-- SET GLOBAL gtid_slave_pos='0-1-1005';
connection slave;
include/start_slave.inc
include/rpl_end.inc
mysql-test/main/rpl_mysqldump_slave.test
View file @
d7c6d306
...
...
@@ -85,7 +85,7 @@ DROP TABLE t2;
#
# MDEV-32611 Added test for mysqldump --delete-master-logs option.
# This options is alias of
# This options is alias of
# get binlogs: show master status -> flush logs -> purge binary logs to <new_binlog>
# sequence and this test is derived using the same pattern.
#
...
...
@@ -101,6 +101,33 @@ insert into t values (2);
drop
table
t
;
--
sync_slave_with_master
# MDEV-32953: Because --delete-master-logs immediately purges logs after
# flushing, it is possible the binlog dump threads will still be using the old
# log when the purge executes, disallowing the file from being deleted.
# Therefore, we temporarily stop the slave so there is no chance the old binlog
# is still being referenced. master_use_gtid=Slave_pos is necessary to still
# appear up-to-date to the master on restart after the master has flushed the
# logs (while the slave is offline). Otherwise (i.e. if using binlog file/pos),
# the slave would point to a purged log file, and receive an error immediately
# upon connecting to the master.
--
source
include
/
stop_slave
.
inc
change
master
to
master_use_gtid
=
slave_pos
;
connection
master
;
--
echo
# Ensuring the binlog dump thread is killed on primary...
--
disable_query_log
--
let
$binlog_dump_thd_tid
=
`SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND LIKE 'Binlog Dump'`
if
(
$binlog_dump_thd_tid
)
{
--
eval
kill
$binlog_dump_thd_tid
}
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
0
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
COMMAND
LIKE
'Binlog Dump'
--
source
include
/
wait_condition
.
inc
--
enable_query_log
--
let
$predump_binlog_filename
=
query_get_value
(
SHOW
MASTER
STATUS
,
File
,
1
)
# Execute mysqldump with delete-master-logs option
...
...
@@ -125,4 +152,7 @@ if ($postdump_first_binary_log_filename != $postdump_binlog_filename)
--die Master binlog wasn'
t
deleted
after
mariadb
-
dump
with
--
delete
-
master
-
logs
.
}
connection
slave
;
--
source
include
/
start_slave
.
inc
--
source
include
/
rpl_end
.
inc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment