diff options
author | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2021-10-20 20:13:45 -0600 |
---|---|---|
committer | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2021-11-01 09:51:30 -0600 |
commit | e9c3de0502a14b720ead3cf053c3d3f4363b65c5 (patch) | |
tree | 237f202a5e949a8a162f5f607f631f92831ae52e /sql/semisync_slave.h | |
parent | 36f8cca6f31941ca6bf5f45cbfdbc9ea676707d9 (diff) | |
download | mariadb-git-10.4-MDEV-11853.tar.gz |
MDEV-11853: semisync thread can be killed after sync binlog but before ACK in the sync state10.4-MDEV-11853
Problem:
========
If a primary is shutdown during an active semi-sync connection
during the period when the primary is awaiting an ACK, the primary
hard kills the active communication thread and does not ensure the
transaction was received by a replica. This can lead to an
inconsistent replication state.
Solution:
========
During shutdown, the primary should wait for an ACK or timeout
before hard killing a thread which is awaiting a communication. We
extend the `SHUTDOWN WAIT FOR SLAVES` logic to identify and ignore
any threads waiting for a semi-sync ACK in phase 1. Then, before
stopping the ack receiver thread, the shutdown is delayed until all
waiting semi-sync connections receive an ACK or time out. The
connections are then killed in phase 2.
Reviewed By:
============
Diffstat (limited to 'sql/semisync_slave.h')
-rw-r--r-- | sql/semisync_slave.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/semisync_slave.h b/sql/semisync_slave.h index d65262f151d..85f515caaf8 100644 --- a/sql/semisync_slave.h +++ b/sql/semisync_slave.h @@ -90,7 +90,7 @@ public: int slave_start(Master_info *mi); int slave_stop(Master_info *mi); int request_transmit(Master_info*); - void kill_connection(MYSQL *mysql); + int kill_connection(MYSQL *mysql); int reset_slave(Master_info *mi); private: |