Bug #92073 int change_master(): Assertion `mi->rli->inited' failed.
Submitted: 20 Aug 2:28 Modified: 7 Nov 11:10
Reporter: Roel Van de Paar (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S6 (Debug Builds)
Version:8.0.12 OS:Any
Assigned to: CPU Architecture:Any

[20 Aug 2:28] Roel Van de Paar
Description:
2018-08-20T02:25:08.576600Z 8 [ERROR] [MY-010729] [Repl] Error reading master configuration.
2018-08-20T02:25:08.578166Z 8 [Warning] [MY-010604] [Repl] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=QAServer-relay-bin' to avoid this problem.
2018-08-20T02:25:08.614766Z 8 [ERROR] [MY-011059] [Repl] Error reading relay log configuration.
mysqld: /git/MS-8.0.12_dbg/sql/rpl_slave.cc:9948: int change_master(THD*, Master_info*, LEX_MASTER_INFO*, bool): Assertion `mi->rli->inited' failed.
02:25:08 UTC - mysqld got signal 6 ;

Core was generated by `/sda/3/bin/mysqld --no-defaults --core-file --basedir=/sda/3 --tmpdir=/sda/3/da'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
57	../sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7f70dd3fe700 (LWP 30756))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x000055a1da41078d in my_write_core (sig=6) at /git/MS-8.0.12_dbg/mysys/stacktrace.cc:278
#2  0x000055a1d9164d94 in handle_fatal_signal (sig=6) at /git/MS-8.0.12_dbg/sql/signal_handler.cc:249
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x00007f70f2467801 in __GI_abort () at abort.c:79
#6  0x00007f70f245739a in __assert_fail_base (fmt=0x7f70f25de7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x55a1db8b4909 "mi->rli->inited", 
    file=file@entry=0x55a1db8af528 "/git/MS-8.0.12_dbg/sql/rpl_slave.cc", line=line@entry=9948, 
    function=function@entry=0x55a1db8b6aa0 <change_master(THD*, Master_info*, LEX_MASTER_INFO*, bool)::__PRETTY_FUNCTION__> "int change_master(THD*, Master_info*, LEX_MASTER_INFO*, bool)") at assert.c:92
#7  0x00007f70f2457412 in __GI___assert_fail (assertion=0x55a1db8b4909 "mi->rli->inited", 
    file=0x55a1db8af528 "/git/MS-8.0.12_dbg/sql/rpl_slave.cc", line=9948, 
    function=0x55a1db8b6aa0 <change_master(THD*, Master_info*, LEX_MASTER_INFO*, bool)::__PRETTY_FUNCTION__> "int change_master(THD*, Master_info*, LEX_MASTER_INFO*, bool)") at assert.c:101
#8  0x000055a1da08e24c in change_master (thd=0x7f70c8c23000, mi=0x7f70dfeba000, lex_mi=0x7f70c8c28b98, preserve_logs=false)
    at /git/MS-8.0.12_dbg/sql/rpl_slave.cc:9948
#9  0x000055a1da08ecee in change_master_cmd (thd=0x7f70c8c23000) at /git/MS-8.0.12_dbg/sql/rpl_slave.cc:10206
#10 0x000055a1d8fb781a in mysql_execute_command (thd=0x7f70c8c23000, first_level=true) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:2932
#11 0x000055a1d8fbdf94 in mysql_parse (thd=0x7f70c8c23000, parser_state=0x7f70dd3fd330) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:4925
#12 0x000055a1d8fb3aeb in dispatch_command (thd=0x7f70c8c23000, com_data=0x7f70dd3fdc90, command=COM_QUERY)
    at /git/MS-8.0.12_dbg/sql/sql_parse.cc:1607
#13 0x000055a1d8fb23c6 in do_command (thd=0x7f70c8c23000) at /git/MS-8.0.12_dbg/sql/sql_parse.cc:1232
#14 0x000055a1d9152678 in handle_connection (arg=0x7f70dff904c0)
    at /git/MS-8.0.12_dbg/sql/conn_handler/connection_handler_per_thread.cc:308
#15 0x000055a1daac1422 in pfs_spawn_thread (arg=0x7f70e5fe7720) at /git/MS-8.0.12_dbg/storage/perfschema/pfs.cc:2836
#16 0x00007f70f3e536db in start_thread (arg=0x7f70dd3fe700) at pthread_create.c:463
#17 0x00007f70f254888f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

How to repeat:
SET SESSION TRANSACTION READ ONLY;
CHANGE MASTER TO MASTER_HOST='0.0.0.0',MASTER_USER='';
SET @@GLOBAL.master_info_repository="FILE";
CHANGE MASTER TO relay_log_file='slave-relay-bin.0',relay_log_pos=0;
[20 Aug 5:15] Umesh Shastry
Hello Roel,

Thank you for the report and test case.
Observed that 8.0.12 debug build is affected.

regards,
Umesh
[20 Aug 5:19] Umesh Shastry
-- 5.7.23 release/debug builds not affected

rm -rf 92073
bin/mysqld-debug --initialize-insecure --basedir=$PWD --datadir=$PWD/92073 --log-error-verbosity=3
bin/mysqld-debug --no-defaults --basedir=$PWD --datadir=$PWD/92073 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/92073/log.err --server_id=1 --log_bin 2>&1 &

mysql> CHANGE MASTER TO relay_log_file='slave-relay-bin.0',relay_log_pos=0;
ERROR 1380 (HY000): Failed initializing relay log position: Could not find target log file mentioned in relay log info in the index file './hod03-relay-bin.index' during relay log initialization
mysql> \q
Bye
[7 Nov 11:10] Margaret Fisher
Posted by developer:
 
Changelog entry not needed, closing.