Fix bug in replication mode and snapshot isolation mode.
authorTatsuo Ishii <ishii@postgresql.org>
Fri, 9 Aug 2024 10:55:05 +0000 (19:55 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Fri, 9 Aug 2024 11:00:46 +0000 (20:00 +0900)
commit1f200d7be9510662d4692112de873de932ac2bac
tree1fb494b2078841d0f6293dd7ae94581afaf63fce
parent3d7edfce88735ed7a7e637ff3e63d9b6c4855170
Fix bug in replication mode and snapshot isolation mode.

In replication mode and snapshot isolation mode when a command fishes,
pgpool waits for a ready for query message but forgot that some
commands (for example SET ROLE) produces a parameter status
message. As a result pgpool errors out that other message arrives
before the ready for query message.  Deal with the case when a
parameter status message arrives.

Here is the test case written in pgproto data format.

'P' "" "SET ROLE TO foo"
'B' "" "" 0 0 0
'E' "" 0
'P' "" "SELECT 1"
'B' "" "" 0 0 0
'E' "" 0
'S'
'Y'

Backpatch-through: v4.1.
src/protocol/pool_proto_modules.c