summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index bf4b1eb0c70..8fb82798a45 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -796,6 +796,25 @@ err:
DBUG_RETURN(error);
}
+/*
+
+ Kill all Binlog_dump threads which previously talked to the same slave
+ ("same" means with the same server id). Indeed, if the slave stops, if the
+ Binlog_dump thread is waiting (pthread_cond_wait) for binlog update, then it
+ will keep existing until a query is written to the binlog. If the master is
+ idle, then this could last long, and if the slave reconnects, we could have 2
+ Binlog_dump threads in SHOW PROCESSLIST, until a query is written to the
+ binlog. To avoid this, when the slave reconnects and sends COM_BINLOG_DUMP,
+ the master kills any existing thread with the slave's server id (if this id is
+ not zero; it will be true for real slaves, but false for mysqlbinlog when it
+ sends COM_BINLOG_DUMP to get a remote binlog dump).
+
+ SYNOPSIS
+ kill_zombie_dump_threads()
+ slave_server_id the slave's server id
+
+*/
+
void kill_zombie_dump_threads(uint32 slave_server_id)
{