[pgpool-committers: 9266] pgpool: Fix occasional 005.jdbc test failure.
Tatsuo Ishii
ishii at sraoss.co.jp
Thu Apr 13 16:40:44 JST 2023
Fix occasional 005.jdbc test failure.
The direct cause of the error is:
2023-02-22 08:51:47.705: PostgreSQL JDBC Driver pid 12420: LOG: Parse: Error or notice message from backend: : DB node id: 0 backend pid: 12488 statement: "COMMIT" message: "prepared statement "S_1" already exists"
Actually the root of the error is this:
2023-02-22 08:51:45.242: PostgreSQL JDBC Driver pid 12420: LOG: pool_send_and_wait: Error or notice message from backend: : DB node id: 0 backend pid: 12488 statement: "DISCARD ALL" message: "DISCARD ALL cannot be executed within a pipeline"
"DISCARD ALL" was generated by pgpool (reset_query_list) to discard
some objects including prepared statements created in the
session. Since DISCARD ALL failed, the prepared statement S_1 was not
removed. Thus the next session failed because S_1 already existed.
To fix this, new global boolean flag reset_query_error is
introduced. The flag is set inside pool_send_and_wait() when a reset
query executed by SimpleQuery() results in ERROR. If the flag is true,
backend_cleanup() discards the backend connection so that any objects,
including named statement, corresponding to the session is discarded
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2023-February/004293.html
Branch
------
V4_0_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=9837eea65d8766e843851871215240b36877d9a8
Modified Files
--------------
src/context/pool_query_context.c | 9 ++++++++-
src/include/pool.h | 1 +
src/main/pool_globals.c | 3 ++-
src/protocol/child.c | 11 +++++++----
src/protocol/pool_process_query.c | 8 +++++++-
src/protocol/pool_proto_modules.c | 12 +++++++++++-
6 files changed, 36 insertions(+), 8 deletions(-)
More information about the pgpool-committers
mailing list