[pgpool-committers: 10060] pgpool: Fix another bug in replication mode and snapshot isolation mode

Tatsuo Ishii ishii at postgresql.org
Sun Aug 11 18:21:02 JST 2024


Fix another bug in replication mode and snapshot isolation mode.

This is a follow up commit for 181d300de6337fe9a10b60ddbd782aa886b563e9.

If previous query produces parameter status message, subsequent
parse() needs to read and process it because it wants to read Ready
for query message which is supposed to follow the parameter status
message.  However when ParameterStatus() gets called, the query in
progress flag was set and it was possible that only one of parameter
status message from backend was processed if the query processed in
this parse() call is load balanced. It is likely that the parameter
status message comes from all live backend because they are generated
by SET command, and SET command are sent to all live backend in
replication mode and snapshot isolation mode. So unset the query in
progress flag before calling ParameterStatus().

Here is the test case written in pgproto data format.

'P'     ""      "SET application_name TO foo"
'B'     ""      ""      0       0       0
'E'     ""      0
'P'     ""      "SELECT 1"
'B'     ""      ""      0       0       0
'E'     ""      0
'P'     ""      "SET application_name TO bar"
'B'     ""      ""      0       0       0
'E'     ""      0
'S'
'Y'
'X'

Backpatch-through: v4.1.

Branch
------
V4_5_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=7a2737c5a389c17cad00794cc9fbc421a525ac9a

Modified Files
--------------
src/protocol/pool_proto_modules.c | 6 ++++++
1 file changed, 6 insertions(+)



More information about the pgpool-committers mailing list