[pgpool-committers: 4051] pgpool: Fix extended query hang in certain case.
Tatsuo Ishii
ishii at postgresql.org
Tue May 23 09:24:56 JST 2017
Fix extended query hang in certain case.
While digging into "[pgpool-general: 5487] pgpool and erlang - request hangs",
http://www.pgpool.net/pipermail/pgpool-general/2017-May/005545.html
I found a certain sequence of messages which cause Pgpool-II hang.
errlang PostgreSQL API produces Parse ('P'), Describe ('D'), Flush
('H'), Bind ('B'), and Execute ('E'). Notice the 'H' message (this
does not happen in JDBC. I suspect that's the reason why this problem
is not popular before). After that, Pgpool-II dropped the extended
query mode, it failed to find which backend to read data. Thus
Pgpool-II simply tries to read all of backend which causes hang
because it may have not send a message to some of backends.
Solution is, after receiving the flush message set doing extended
query flag.
For the record, here is the pgproto data to reproduce the problem.
--------------------------------------------------------
'Q' "DROP TABLE IF EXISTS pgproto_test1"
'Y'
'Q' "CREATE TABLE pgproto_test1(i INT)"
'Y'
'Q' "INSERT INTO pgproto_test1 VALUES(1)"
'Y'
'P' "S2" "SELECT 1 FROM pgproto_test1" 0
'D' 'S' "S2"
'H'
'B' "" "S2" 0 0 0
'E' "" 0
'C' 'S' "S2"
'S'
'Y'
'X'
--------------------------------------------------------
Note that the cause of original complain seems to different from this
because it is operated in replication mode. So it needs more
investigation.
Back patched to 3.6 and 3.5 stable branches.
Branch
------
V3_5_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=27a516a3a9fd0e47f40422f7997cf5eb415a97b2
Modified Files
--------------
src/protocol/pool_proto_modules.c | 4 ++++
1 file changed, 4 insertions(+)
More information about the pgpool-committers
mailing list