mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
eb75e8705d
Problem: ======== Auto purge of relaylogs stops when relay-log-file is 'slave-relay-log.999999' and slave_parallel_threads is enabled. Analysis: ========= The problem is that in Relay_log_info::inc_group_relay_log_pos() function, when two log names are compared via strcmp() function, it gives correct result, when log name sequence numbers are of same digits(6 digits), But when the number goes to 7 digits, a 999999 compares greater than 1000000, which is wrong, hence the bug. Fix: ==== Extract the numeric extension part of the file name, convert it into unsigned long and compare. Thanks to David Zhao for the contribution.
37 lines
1,009 B
Text
37 lines
1,009 B
Text
include/rpl_init.inc [topology=1->2]
|
|
connection server_2;
|
|
include/stop_slave.inc
|
|
RESET SLAVE;
|
|
include/start_slave.inc
|
|
include/stop_slave.inc
|
|
#
|
|
# Stop slave server
|
|
#
|
|
#
|
|
# Simulate file number get close to 999997
|
|
# by renaming relay logs and modifying index/info files
|
|
#
|
|
# Restart slave server
|
|
#
|
|
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
|
SET @save_max_relay_log_size= @@GLOBAL.max_relay_log_size;
|
|
SET GLOBAL slave_parallel_threads=1;
|
|
SET GLOBAL max_relay_log_size=100 * 1024;
|
|
include/start_slave.inc
|
|
connection server_1;
|
|
create table t1 (i int, c varchar(1024));
|
|
#
|
|
# Insert some data to generate enough amount of binary logs
|
|
#
|
|
connection server_2;
|
|
#
|
|
# Assert that 'slave-relay-bin.999999' is purged.
|
|
#
|
|
NOT FOUND /slave-relay-bin.999999/ in slave-relay-bin.index
|
|
include/stop_slave.inc
|
|
SET GLOBAL slave_parallel_threads= @save_slave_parallel_threads;
|
|
SET GLOBAL max_relay_log_size= @save_max_relay_log_size;
|
|
include/start_slave.inc
|
|
connection server_1;
|
|
DROP TABLE t1;
|
|
include/rpl_end.inc
|