diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2016-07-25 13:07:50 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-01-06 10:46:20 +0100 |
commit | 43378f367c5c01ebc214919006e2072fb2356724 (patch) | |
tree | 9b93abca9b69e6736306283b775e3fed4d6d0935 /sql/slave.cc | |
parent | 670b85804ca6d3b0e640a7ddbb5b6e494bec7c2b (diff) | |
download | mariadb-git-43378f367c5c01ebc214919006e2072fb2356724.tar.gz |
MDEV-10271: Stopped SQL slave thread doesn't print a message to error log like IO thread does
Make the slave SQL thread always output to the error log the message "Slave
SQL thread exiting, replication stopped in ..." whenever it previously
outputted "Slave SQL thread initialized, starting replication ...".
Before this patch, it was somewhat inconsistent in which cases the message
would be output and in which not, depending on the exact time and cause of
the condition that caused the SQL thread to stop.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 65bcdc48c6a..c4817ef4794 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4574,11 +4574,11 @@ pthread_handler_t handle_slave_sql(void *arg) { rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL, "Error initializing relay log position: %s", errmsg); - goto err; + goto err_before_start; } rli->reset_inuse_relaylog(); if (rli->alloc_inuse_relaylog(rli->group_relay_log_name)) - goto err; + goto err_before_start; strcpy(rli->future_event_master_log_name, rli->group_master_log_name); THD_CHECK_SENTRY(thd); @@ -4738,6 +4738,7 @@ log '%s' at position %s, relay log '%s' position: %s%s", RPL_LOG_NAME, } } + err: if (mi->using_parallel()) rli->parallel.wait_for_done(thd, rli); @@ -4757,15 +4758,7 @@ log '%s' at position %s, relay log '%s' position: %s%s", RPL_LOG_NAME, tmp.c_ptr_safe()); } - err: - - /* - Once again, in case we aborted with an error and skipped the first one. - (We want the first one to be before the printout of stop position to - get the correct position printed.) - */ - if (mi->using_parallel()) - rli->parallel.wait_for_done(thd, rli); + err_before_start: /* Some events set some playgrounds, which won't be cleared because thread |