diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-09-12 15:01:55 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-09-12 15:01:55 +0300 |
commit | 0ccb95c2a9c3107c7dfa1745a64c50d071fb8f4b (patch) | |
tree | 1e6dbbb14b13f6e0ca3d1ebf9652bfcf2eb4d658 /sql/log.cc | |
parent | 70021737f541a0cb0732c76d04958b16a47dec49 (diff) | |
parent | bc12478a9a2ac77937c18f54d6c6563d5c1980f9 (diff) | |
download | mariadb-git-0ccb95c2a9c3107c7dfa1745a64c50d071fb8f4b.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc index 15de3f46275..30913d3071a 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3406,6 +3406,7 @@ void MYSQL_BIN_LOG::stop_background_thread() &LOCK_binlog_background_thread); mysql_mutex_unlock(&LOCK_binlog_background_thread); binlog_background_thread_started= false; + binlog_background_thread_stop= true; // mark it's not going to restart } } @@ -3604,7 +3605,8 @@ bool MYSQL_BIN_LOG::open(const char *log_name, DBUG_RETURN(1); } - if (!binlog_background_thread_started && + if ((!binlog_background_thread_started && + !binlog_background_thread_stop) && start_binlog_background_thread()) DBUG_RETURN(1); } @@ -10497,6 +10499,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 @@ -10586,6 +10589,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(); |