From 4357b07fb2d13f5f711ef721b80fd96ac758787c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 20:19:43 +0000 Subject: [PATCH 1/2] Initial plan From 8589e0816570aaaa0021b69b5fa06dbc5635581f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 20:37:53 +0000 Subject: [PATCH 2/2] Fix MySQL binlog_proxy.py to properly disconnect both sides for reconnection testing Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com> --- .../mysql_tests/scripts/utils/binlog_proxy.py | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/docker/mysql_tests/scripts/utils/binlog_proxy.py b/docker/mysql_tests/scripts/utils/binlog_proxy.py index 3a31492b88..b3d718cabe 100644 --- a/docker/mysql_tests/scripts/utils/binlog_proxy.py +++ b/docker/mysql_tests/scripts/utils/binlog_proxy.py @@ -51,6 +51,7 @@ def handle_client_connection(self, client_socket): if not self.connect_to_server(): print("[Proxy] Initial connection to server failed") + client_socket.close() return self.connection_start_time = time.time() @@ -62,21 +63,18 @@ def handle_client_connection(self, client_socket): print(f"[Proxy] Planned disconnect #{self.disconnect_count + 1}/{self.planned_disconnects} after {self.bytes_transferred} bytes") print(f"[Proxy] Total bytes transferred so far: {self.total_bytes_transferred}") - self.server_socket.close() - time.sleep(2) - self.disconnect_count += 1 if self.disconnect_count >= self.planned_disconnects: self.disconnects_completed = True - print(f"[Proxy] Completed all {self.planned_disconnects} planned disconnects. Now working in stable mode.") - - if not self.connect_to_server(): - print("[Proxy] Reconnection failed, closing client connection") - break - - self.connection_start_time = time.time() - self.bytes_transferred = 0 + print(f"[Proxy] Completed all {self.planned_disconnects} planned disconnects. Next connection will be stable.") + + # Close both connections to force MySQL to reconnect with its current + # GTID set. Reconnecting only the server side would corrupt the + # replication protocol by sending a new MySQL handshake to MySQL + # while it expects binlog events. + print(f"[Proxy] Closing both connections to force client reconnect") + return try: ready_sockets, _, error_sockets = select.select(