[pgpool-hackers: 4020] Re: [pgpool-committers: 8027] pgpool: Fix occasional hang in COPY FROM.

Tatsuo Ishii ishii at sraoss.co.jp
Sat Sep 18 15:18:48 JST 2021


This message is just to share my fix.

The issue was that it was possible that COPY FROM was stuck in
Pgpool-II.  I think this issue was there since COPY FROM was
implemented. The reason why there had been no report from the field
was, the issue only occur when an error message was sent during COPY.

Since the bug was in all branches of Pgpool-II, I have pushed the fix
to all supported branches.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

From: Tatsuo Ishii <ishii at sraoss.co.jp>
Subject: [pgpool-committers: 8027] pgpool: Fix occasional hang in COPY FROM.
Date: Thu, 16 Sep 2021 08:01:31 +0000
Message-ID: <E1mQmKp-0003iE-MC at gothos.postgresql.org>

> Fix occasional hang in COPY FROM.
> 
> If an error occurs while doing COPY FROM, it was possible the
> Pgpool-II waited forever for a response from backend after COPY end
> marker was sent from frontend. Pgpool expected a new message arrives
> to socket, but it is possible that the message (in this case an error
> message) is already in the backend read buffer. The fix is, check the
> buffer is empty or not before reading from the socket.
> New test case (07.copy_hang) is also added.
> 
> The bug was found by Bo Peng.
> 
> Branch
> ------
> master
> 
> Details
> -------
> https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=a874078de54f63f958fa622295e06508b99a4a60
> 
> Modified Files
> --------------
> src/protocol/pool_proto_modules.c               | 14 ++++++-
> src/test/regression/tests/076.copy_hang/test.sh | 54 +++++++++++++++++++++++++
> 2 files changed, 67 insertions(+), 1 deletion(-)
> 


More information about the pgpool-hackers mailing list