[MDEV-32385] Semi-Sync Ack_Receiver Thread Should Allow COM_QUIT Command Created: 2023-10-09  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1

Type: Bug Priority: Major
Reporter: Brandon Nesterenko Assignee: Brandon Nesterenko
Resolution: Unresolved Votes: 1
Labels: None

Issue Links:
Relates
relates to MXS-4792 Semi-sync replication through MaxScal... Closed
relates to MDEV-28141 Slave crashes with Packets out of ord... Open
relates to MDEV-32551 "Read semi-sync reply magic number er... Closed

 Description   

The semi-sync protocol between a replica and primary is implemented such that all ACK packets from the replica set a "magic" bit at the start of the packet. The primary's Ack_Receiver thread has a check to ensure that all packets sent from the replica have this bit set (if semi-sync is active), and if not, an error is indicated. When a semi-sync replica stops its connection with the primary (either by STOP SLAVE or in error), it cannot use the API mysql_close() function, because it automatically sends a COM_QUIT command on the connection, which does not conform to the semi-sync protocol. To get around this, the replica will create a new non-semi-sync connection with the primary, and issue a KILL command to outwardly kill the semi-sync connection.

However, if a third party sits in-between this connection as a proxy, and sends a COM_QUIT to sever the connection, the primary will report the error. To accommodate this set-up, the primary's Ack_Receiver thread should allow for an exception to the protocol if the packet is a COM_QUIT command.


Generated at Thu Feb 08 10:30:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.