diff options
author | Andrei <andrei.elkin@mariadb.com> | 2022-08-09 19:28:49 +0300 |
---|---|---|
committer | Andrei <andrei.elkin@mariadb.com> | 2022-08-09 20:12:07 +0300 |
commit | 9df047f264db3a114026849d64b691d1301d8109 (patch) | |
tree | 89d78b5221e8687b443b6863884b57659b1d69a3 | |
parent | 373a00fea0ec8b1c949f90b2fc407b40035be4cc (diff) | |
download | mariadb-git-9df047f264db3a114026849d64b691d1301d8109.tar.gz |
MDEV-24660 MYSQL_BIN_LOG::cleanup(): Assertion `b->xid_count == 0'bb-10.10-MDEV-28883
The assert fired at shutdown time to indicate a missed decrement to
the count. The counter could not have been decremented because
the binlog background thread had already gone.
Fixed with relocation the binlog background thread exit in the server
shutdown module.
-rw-r--r-- | sql/log.cc | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc index 619d5ffaccd..0b008e7abbb 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -10631,6 +10631,7 @@ binlog_background_thread(void *arg __attribute__((unused))) thd->store_globals(); thd->security_ctx->skip_grants(); thd->set_command(COM_DAEMON); + THD_count::count--; /* Load the slave replication GTID state from the mysql.gtid_slave_pos @@ -10720,6 +10721,7 @@ binlog_background_thread(void *arg __attribute__((unused))) THD_STAGE_INFO(thd, stage_binlog_stopping_background_thread); /* No need to use mutex as thd is not linked into other threads */ + THD_count::count++; delete thd; my_thread_end(); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1e30d8f3644..d60eeb34962 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1781,7 +1781,6 @@ static void close_connections(void) Events::deinit(); slave_prepare_for_shutdown(); - mysql_bin_log.stop_background_thread(); ack_receiver.stop(); /* @@ -1965,6 +1964,7 @@ static void clean_up(bool print_message) logger.cleanup_base(); injector::free_instance(); + mysql_bin_log.stop_background_thread(); mysql_bin_log.cleanup(); my_tz_free(); |