[pgpool-committers: 3875] pgpool: Fix occasional kind mismatch error (or hang) and deallocate err

Tatsuo Ishii ishii at postgresql.org
Wed Mar 29 10:52:26 JST 2017

Fix occasional kind mismatch error (or hang) and deallocate error.

There were following problems causing the first one:

1) pool_push_pending_data() does not push pending data if the first
   pending message is '3' close complete because
   pool_push_pending_data() cannot distinguish from the same kind of
   message generated by it. Checking if backend buffer is empty is not
   enough, since it is possible that the message was not read into the
   buffer yet. To solve the problem do_query() is modified to check if
   '3' is received prior to '1' parse complete. If so, it is likely
   that pool_push_pending_data() failed to check the message and
   do_query() pushes the message.

2) CloseComplete() deletes a close pending message. This should not be
   done by CloseComplete() since read_kind_from_backend() is in charge
   of it using pool_pending_message_pull_out().

The latter is, deallocate does not find the statement to be
deleted. This is caused in that send_deallocate() can be called in the
reset query list processing. Since DISCARD ALL automatically
deallocate all the named statement or portal, send_deallocate() is
useless. Solution is, just deleting the call in the reset query list



Modified Files
src/context/pool_session_context.c         | 25 ++++-----
src/include/context/pool_session_context.h |  2 +-
src/protocol/pool_process_query.c          | 83 +++++++++++++++---------------
src/protocol/pool_proto_modules.c          | 21 +++++++-
4 files changed, 75 insertions(+), 56 deletions(-)

More information about the pgpool-committers mailing list