[pgpool-general: 5612] pgpool 3.6.4 does not always pass database exception to application and cause it to get stuck

Avi Weinberg AviW at gilat.com
Sun Jul 9 20:04:27 JST 2017

Hi All,

I'm using pgpool 3.6.4 master-slave with load balancing.  On many occasions a database exception is not passed to the application and the application get stuck.  I opened a bug - https://www.pgpool.net/mantisbt/view.php?id=318  but pgpool developers were not able to reproduce it yet.  I will greatly appreciate if some of you could please run the following script and check if the bug is reproduced on your setup.

To run the sh script you need to have   pgproto (https://github.com/tatsuo-ishii/pgproto)   which was developed by Tatsuo-ishii to simulate pgpool problems.

The following is a short shell script to run pgproto in a loop.  The bug318.data input file is also supplied below.

Please note that it fails on setup running pgpool 3.6.4 with replication master+slave and load balancing. If you have setup with only master (slave is down) you will not see the bug. Please run the sh script and see if it manage to finish the loop without error.



for ((n=0; n<10000; n++))
   echo "iteration $n "
   pgproto -f bug318.data -p 9999 -h your_ip_address -u postgres -d your_db_name > $File;
) 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S:"), $0; fflush(); }' | tee -a "$File"

if grep -q Terminate "$File"; then
   echo "ok"
   echo "Bug"


The following is a bug318.data used by the batch script (which calls pgproto)

'Q'     "SET statement_timeout = '4s'"

# Receive response from backend

# Execute statement
'P'     "S1"    "SELECT 1/0"    0
'B'     ""      "S1"    0       0       0
'E'     ""      0
'C'     'S'     "S1"

# Execute statement
'P'     "S2"    "SELECT 1/0"    0
'B'     ""      "S2"    0       0       0
'E'     ""      0
'C'     'S'     "S2"

# Issue Sync message

# Receive response from backend

# Send terminate message

IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20170709/15545830/attachment.html>

More information about the pgpool-general mailing list