From 3c9811c92bc9ea23000f0c792cff22f97de475a7 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Mon, 11 Nov 2024 20:17:28 +0900 Subject: [PATCH] Fix COPY hangs. During COPY IN state (i.e. COPY FROM STDIN), frontend can send Flush or Sync messages. According to the F/B protocol specification, they should be ignored but Pgpool-II treated as an invalid message and this causes COPY hung. Discussion: https://github.com/pgpool/pgpool2/issues/79 Backpatch-through: v4.1 --- 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 f12da9bdc..b17f6b4a1 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -3338,6 +3338,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)