From: Tatsuo Ishii Date: Mon, 11 Nov 2024 11:17:28 +0000 (+0900) Subject: Fix COPY hangs. X-Git-Tag: V4_6_0_BETA1~33 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ab091663b09ef8c2d0a1841921597948c597444e;p=pgpool2.git 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 --- diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index 4988325dc..9aa0d7736 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -3398,6 +3398,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)