From bb05e597303e026209a7ddfafc8f37a471755e8b Mon Sep 17 00:00:00 2001 From: Vigneshkumar Date: Mon, 11 Nov 2024 09:19:43 +0530 Subject: [PATCH 1/2] Update pool_proto_modules.c --- src/protocol/pool_proto_modules.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index 4988325dc..e1c483964 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -2960,6 +2960,14 @@ ProcessFrontendResponse(POOL_CONNECTION * frontend, * If data remains in the frontend write buffer, flush it * now. */ + if (!pool_read_buffer_is_empty(frontend)) ++ { ++ /* If data remains in the frontend buffer, flush it now. */ ++ pool_flush(frontend); ++ elog(DEBUG5, ++ "pending data flushed to frontend due to a flush message"); ++ } + pool_flush(frontend); elog(DEBUG5, "pending data flushed to frontend due to a flush message"); From 5845b5f65483ade69c33ad3a054f6f65c4573d08 Mon Sep 17 00:00:00 2001 From: HariKalakada <104896390+HariKalakada@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:50:53 +0530 Subject: [PATCH 2/2] Update pool_proto_modules.c --- src/protocol/pool_proto_modules.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index e1c483964..e917db995 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -3406,6 +3406,12 @@ CopyDataRows(POOL_CONNECTION * frontend, copy_count++; continue; } + /* + * Flush (H) or Sync (S) messages should be ignored while in + * the COPY IN mode. + */ + else if (kind == 'H' || kind == 'S') + continue; else { if (pool_config->log_client_messages && copy_count != 0)