Skip to content

Commit fa14c42

Browse files
hartmut-mariadbgrooverdan
authored andcommitted
MDEV-10271: add master host/port info to slave thread exit messages
Sample log error message generated: mysql-test/var/log/mysqld.2.err:2021-01-21 13:02:30 8 [Note] Slave SQL thread exiting, replication stopped in log 'master-bin.000001' at position 329, master: 127.0.0.1:16000 mysql-test/var/log/mysqld.2.err:2021-01-21 13:02:30 7 [Note] Slave I/O thread exiting, read up to log 'master-bin.000001', position 329, master 127.0.0.1:16000 mysql-test/var/log/mysqld.2.err:2021-01-21 13:02:30 12 [Note] Slave SQL thread exiting, replication stopped in log 'master-bin.000001' at position 329; GTID position '', master: 127.0.0.1:16000 Reviewer: knielsen@knielsen-hq.org, Andrei and Sachin
1 parent 9a08fcb commit fa14c42

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sql/slave.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5106,15 +5106,16 @@ log space");
51065106
// print the current replication position
51075107
if (mi->using_gtid == Master_info::USE_GTID_NO)
51085108
sql_print_information("Slave I/O thread exiting, read up to log '%s', "
5109-
"position %llu", IO_RPL_LOG_NAME, mi->master_log_pos);
5109+
"position %llu, master %s:%d", IO_RPL_LOG_NAME, mi->master_log_pos,
5110+
mi->host, mi->port);
51105111
else
51115112
{
51125113
StringBuffer<100> tmp;
51135114
mi->gtid_current_pos.to_string(&tmp);
51145115
sql_print_information("Slave I/O thread exiting, read up to log '%s', "
5115-
"position %llu; GTID position %s",
5116+
"position %llu; GTID position %s, master %s:%d",
51165117
IO_RPL_LOG_NAME, mi->master_log_pos,
5117-
tmp.c_ptr_safe());
5118+
tmp.c_ptr_safe(), mi->host, mi->port);
51185119
}
51195120
repl_semisync_slave.slave_stop(mi);
51205121
thd->reset_query();
@@ -5717,8 +5718,9 @@ pthread_handler_t handle_slave_sql(void *arg)
57175718
tmp.append(STRING_WITH_LEN("'"));
57185719
}
57195720
sql_print_information("Slave SQL thread exiting, replication stopped in "
5720-
"log '%s' at position %llu%s", RPL_LOG_NAME,
5721-
rli->group_master_log_pos, tmp.c_ptr_safe());
5721+
"log '%s' at position %llu%s, master: %s:%d", RPL_LOG_NAME,
5722+
rli->group_master_log_pos, tmp.c_ptr_safe(),
5723+
mi->host, mi->port);
57225724
}
57235725
#ifdef WITH_WSREP
57245726
wsrep_after_command_before_result(thd);

0 commit comments

Comments
 (0)