From 49ecb8bd2c4109d0ab31d48a34e9755416cc2516 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 22 Feb 2023 13:55:41 +0100 Subject: [PATCH] Fix for semisync replication: clear network buffer before sending the reply packet to the server. --- libmariadb/mariadb_rpl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmariadb/mariadb_rpl.c b/libmariadb/mariadb_rpl.c index 37dbf330..65a26547 100644 --- a/libmariadb/mariadb_rpl.c +++ b/libmariadb/mariadb_rpl.c @@ -1816,6 +1816,9 @@ MARIADB_RPL_EVENT * STDCALL mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVEN memcpy(buffer + 9, rpl->filename, rpl->filename_length); buffer[buf_size - 1]= 0; + /* clear network buffer before sending the reply packet*/ + ma_net_clear(&rpl->mysql->net); + if (ma_net_write(&rpl->mysql->net, buffer, buf_size) || (ma_net_flush(&rpl->mysql->net))) goto net_error;