[pgpool-hackers: 2013] Re: [pgpool-committers: 3783] pgpool: Fix do_query() hangs after close message.

Tatsuo Ishii ishii at sraoss.co.jp
Fri Jan 27 16:26:28 JST 2017


For a record, here is the test data for Pgproto
(https://github.com/tatsuo-ishii/pgproto).

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
------------------------------------------------------------
#
# Pgproto test data to reprduce the en-bug in pgpool-II 3.6.1,
# blaming commit 9274f827ea28e12968158e1c56f6d7a7b1227570.

# If an extend query appears right after a close message, do_query()
# is called to check system catalogs, it hangs because it expects to
# read pending data. This is caused by being mistakenly set the
# pending flag after Close().

# FE=> Parse(stmt="S1", query="BEGIN")
# FE=> Bind(stmt="S1", portal="")
# FE=> Execute(portal="")
# FE=> Close(stmt="S1")
# FE=> Parse(stmt="S2", query="SELECT 1")
# FE=> Bind(stmt="S2", portal="")
# FE=> Execute(portal="")
# FE=> Close(stmt="S2")
# FE=> Parse(stmt="S3", query="INSERT INTO t1 VALUES(1)")
# FE=> Bind(stmt="S3", portal="")
# FE=> Execute(portal="")
# FE=> Close(stmt="S3")
# FE=> Parse(stmt="S4", query="COMMIT")
# FE=> Bind(stmt="S4", portal="")
# FE=> Execute(portal="")
# FE=> Close(stmt="S4")
# FE=> Sync
# <= BE ParseComplete
# <= BE BindComplete
# <= BE CommandComplete(BEGIN)
# <= BE CloseComplete <-- hang right after here.

# Create test table
'Q'	"DROP TABLE IF EXISTS pgproto_test1"
'Y'
'Q'	"CREATE TABLE pgproto_test1(i INT)"
'Y'

# Issue SELECT
'P'	"S1"	"SELECT 1"	0
'B'	""	"S1"	0	0	0
'E'	""	0

# Close the statement
'C'	'S'	"S1"

# Issue SELECT
'P'	"S1"	"SELECT * FROM pgproto_test1"	0
'B'	""	"S1"	0	0	0
'E'	""	0

# Sync
'S'

# Recieve result
'Y'

# Terminate session
'X'
------------------------------------------------------------

From: Tatsuo Ishii <ishii at postgresql.org>
Subject: [pgpool-committers: 3783] pgpool: Fix do_query() hangs after close message.
Date: Fri, 27 Jan 2017 07:22:20 +0000
Message-ID: <E1cX0rU-0000XF-Kj at gothos.postgresql.org>

> Fix do_query() hangs after close message.
> 
> This is an en-bug in 3.6.1.
> 
> If an extend query appears right after a close message, do_query() is
> called to check system catalogs, it hangs because it expects to read
> pending data. This is caused by being mistakenly set the pending flag
> after Close().
> 
> Back patch to 3.6-stable and 3.5-stable.
> 
> Branch
> ------
> master
> 
> Details
> -------
> http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=e3fc50a13818d41b61b721092bc41556e8a62bab
> 
> Modified Files
> --------------
> src/context/pool_session_context.c | 6 ++++++
> src/protocol/pool_proto_modules.c  | 5 ++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
> 
> _______________________________________________
> pgpool-committers mailing list
> pgpool-committers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-committers


More information about the pgpool-hackers mailing list