pgpool2.git / summary / log / commit / refs
commit f5b52e69e57787c37baa641c99383b2934007a65
Author: Tatsuo Ishii <ishii at sraoss.co.jp>
Date: Wed Apr 08 11:12:11 2009 +0000
In master slave mode, sometimes DEALLOCATE fails. This is caused
by that the first PREPARE was not executed on the slave.
Patch contributed by Toshihiro Kitagawa.
pool_proto_modules.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/pool_proto_modules.c b/pool_proto_modules.c
index ab6b59796..d53b5d953 100644
--- a/pool_proto_modules.c
+++ b/pool_proto_modules.c
@@ -347,7 +347,7 @@ POOL_STATUS NotificationResponse(POOL_CONNECTION *frontend,
force_replication = 1;
/*
- * Before we do followings only when frontend == NULL,
+ * Before we did followings only when frontend != NULL,
* which was wrong since if, for example, reset_query_list
* contains "DISCARD ALL", then it does not register
* pending function and it causes trying to DEALLOCATE non
@@ -664,18 +664,6 @@ POOL_STATUS Execute(POOL_CONNECTION *frontend,
pool_debug("Execute: portal name <%s>", string);
- if (receive_extended_begin)
- {
- /* send sync message */
- send_extended_protocol_message(backend, MASTER_NODE_ID, "S", 0, "");
-
- kind = pool_read_kind(backend);
- if (kind != 'Z')
- return POOL_END;
- if (ReadyForQuery(frontend, backend, 0) != POOL_CONTINUE)
- return POOL_END;
- }
-
portal = lookup_prepared_statement_by_portal(&prepared_list,
string);
@@ -1437,6 +1425,7 @@ POOL_STATUS ProcessFrontendResponse(POOL_CONNECTION *frontend,
POOL_CONNECTION_POOL *backend)
{
char fkind;
+ char kind;
POOL_STATUS status;
int i;
@@ -1451,6 +1440,18 @@ POOL_STATUS ProcessFrontendResponse(POOL_CONNECTION *frontend,
pool_debug("read kind from frontend %c(%02x)", fkind, fkind);
+ if (receive_extended_begin)
+ {
+ /* send sync message */
+ send_extended_protocol_message(backend, MASTER_NODE_ID, "S", 0, "");
+
+ kind = pool_read_kind(backend);
+ if (kind != 'Z')
+ return POOL_END;
+ if (ReadyForQuery(frontend, backend, 0) != POOL_CONTINUE)
+ return POOL_END;
+ }
+
switch (fkind)
{
[parent: 7a097f0b0d0a]