mariadb/mysql-test/suite
Brandon Nesterenko a83c7ab1ea MDEV-11853: semisync thread can be killed after sync binlog but before ACK in the sync state
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.

Notes:
 1) There remains an unresolved corner case that affects this
patch. MDEV-28141: Slave crashes with Packets out of order when
connecting to a shutting down master. Specifically, If a slave is
connecting to a master which is actively shutting down, the slave
can crash with a "Packets out of order" assertion error. To get
around this issue in the MTR tests, the primary will wait a small
amount of time before phase 1 killing threads to let the replicas
safely stop (if applicable).
 2) This patch also fixes MDEV-28114: Semi-sync Master ACK Receiver
Thread Can Error on COM_QUIT

Reviewed By
============
Andrei Elkin <andrei.elkin@mariadb.com>
2022-04-22 12:59:54 -06:00
..
archive
binlog
binlog_encryption
compat Merge 10.3 into 10.4 2022-04-21 11:33:59 +03:00
csv
encryption Merge 10.3 into 10.4 2022-04-06 08:59:09 +03:00
engines
federated
funcs_1 Merge 10.3 into 10.4 2022-04-21 11:33:59 +03:00
funcs_2
galera Merge 10.3 into 10.4 2022-04-21 11:33:59 +03:00
galera_3nodes Merge 10.3 into 10.4 2022-04-21 11:33:59 +03:00
galera_3nodes_sr
galera_sr
gcol MDEV-28227 Error message Chinese translation 2022-04-21 13:57:08 +10:00
handler
heap
innodb MDEV-26224 InnoDB fails to remove AUTO_INCREMENT attribute 2022-04-21 15:23:21 +03:00
innodb_fts
innodb_gis
innodb_zip
jp
json
large_tests
maria Merge 10.3 into 10.4 2022-04-21 11:33:59 +03:00
mariabackup Merge 10.3 into 10.4 2022-04-06 08:59:09 +03:00
mtr/t
mtr2
multi_source
optimizer_unfixed_bugs
parts Merge 10.3 into 10.4 2022-04-21 11:33:59 +03:00
perfschema
perfschema_stress
period
plugins
roles
rpl MDEV-11853: semisync thread can be killed after sync binlog but before ACK in the sync state 2022-04-22 12:59:54 -06:00
sql_sequence
storage_engine
stress
sys_vars MDEV-22266: Diagnostics_area::sql_errno() const: Assertion 2022-04-12 01:22:51 +05:30
unit
vcol Merge 10.3 into 10.4 2022-04-21 11:33:59 +03:00
versioning MDEV-24529 Assertion failed in vers_select_conds_t::print 2022-04-18 11:19:34 +03:00
wsrep