mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
BUG#55263: assert in check_binlog_magic
The procedure for setting up a fake binary log, by changing the relay log files manually, is run twice when we issue mtr with --repeat=2. However, when setting it up for the second time, neither the sql thread is reset nor the server is restarted. This means that previous stale relay log IO_CACHE metadata - from first run - is left around. As a consequence, when the test is run for the second time, the IO_CACHE for the relay log has position in file different than zero, triggering the assertion. We fix this by deploying a call to my_b_seek before calling check_binlog_magic in next_event. This prevents the server from asserting, in the cases that the SQL thread was reads from a hot log (relay.NNNNN), then is stopped, then is restarted from a previous cold log (relay.MMMMM), and then it reaches the hot log relay.NNNNN again, in which case, the read coordinates are not set to zero, but to the old values. Additionally, some comments to the source code were added.
This commit is contained in:
@ -94,6 +94,16 @@ public:
|
||||
*/
|
||||
MYSQL_BIN_LOG relay_log;
|
||||
LOG_INFO linfo;
|
||||
|
||||
/*
|
||||
cur_log
|
||||
Pointer that either points at relay_log.get_log_file() or
|
||||
&rli->cache_buf, depending on whether the log is hot or there was
|
||||
the need to open a cold relay_log.
|
||||
|
||||
cache_buf
|
||||
IO_CACHE used when opening cold relay logs.
|
||||
*/
|
||||
IO_CACHE cache_buf,*cur_log;
|
||||
|
||||
/* The following variables are safe to read any time */
|
||||
|
Reference in New Issue
Block a user