pgpool2.git / summary / log / commit / refs
commit 5b197f088b304dd4d7fd2fcf7c01a2a32726c683
Author: Tatsuo Ishii <ishii at sraoss.co.jp>
Date: Thu Jul 21 23:19:32 2011 +0000
It appears that the last commit below has problem with the case
PREPARE(non extended protocol case) raises error, pointed out by
Toshihiro Kitagawa. ReadyForQuery() is changed to call
pool_unset_query_in_progress() whenver query_in_progress is set
(before it was only called when command_success is set).
Subject: [Pgpool-committers] pgpool - pgpool-II: Fix ProcessBackendResponse() so that it calls
From: t-ishii@pgfoundry.org (User T-ishii)
To: pgpool-committers@pgfoundry.org
Date: Wed, 20 Jul 2011 10:41:10 +0000 (UTC)
Log Message:
-----------
Fix ProcessBackendResponse() so that it calls pool_unset_command_success()
rather than pool_set_command_success() when received Error Response.
Modified Files:
--------------
pgpool-II:
pool_proto_modules.c (r1.99 -> r1.100)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/pool_proto_modules.c?r1=1.99&r2=1.100)
pool_proto_modules.c | 87 +++++++++++++++++++++++++++-------------------------
1 file changed, 45 insertions(+), 42 deletions(-)
diff --git a/pool_proto_modules.c b/pool_proto_modules.c
index 2f113571d..72d800b7f 100644
--- a/pool_proto_modules.c
+++ b/pool_proto_modules.c
@@ -1288,54 +1288,57 @@ POOL_STATUS ReadyForQuery(POOL_CONNECTION *frontend,
pool_flush(frontend);
}
- if (pool_is_query_in_progress() && pool_is_command_success())
+ if (pool_is_query_in_progress())
{
- node = pool_get_parse_tree();
- query = pool_get_query_string();
-
- if (node)
+ if (pool_is_command_success())
{
- /*
- * If the query was BEGIN/START TRANSACTION, clear the
- * history that we had a writing command in the transaction
- * and forget the transaction isolation level.
- */
- if (is_start_transaction_query(node))
- {
- pool_unset_writing_transaction();
- pool_unset_failed_transaction();
- pool_unset_transaction_isolation();
- }
+ node = pool_get_parse_tree();
+ query = pool_get_query_string();
- /*
- * SET TRANSACTION ISOLATION LEVEL SERIALIZABLE or SET
- * SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL
- * SERIALIZABLE, remember it.
- */
- else if (is_set_transaction_serializable(node, query))
+ if (node)
{
- pool_set_transaction_isolation(POOL_SERIALIZABLE);
- }
+ /*
+ * If the query was BEGIN/START TRANSACTION, clear the
+ * history that we had a writing command in the transaction
+ * and forget the transaction isolation level.
+ */
+ if (is_start_transaction_query(node))
+ {
+ pool_unset_writing_transaction();
+ pool_unset_failed_transaction();
+ pool_unset_transaction_isolation();
+ }
- /*
- * If 2PC commands has been executed, automatically close
- * transactions on standbys if there is any open
- * transaction since 2PC commands close transaction on
- * primary.
- */
- else if (is_2pc_transaction_query(node, query))
- {
- if (close_standby_transactions(frontend, backend) != POOL_CONTINUE)
- return POOL_END;
- }
+ /*
+ * SET TRANSACTION ISOLATION LEVEL SERIALIZABLE or SET
+ * SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL
+ * SERIALIZABLE, remember it.
+ */
+ else if (is_set_transaction_serializable(node, query))
+ {
+ pool_set_transaction_isolation(POOL_SERIALIZABLE);
+ }
- /*
- * If the query was not READ SELECT, remember that we had
- * a write query in this transaction.
- */
- else if (!is_select_query(node, query))
- {
- pool_set_writing_transaction();
+ /*
+ * If 2PC commands has been executed, automatically close
+ * transactions on standbys if there is any open
+ * transaction since 2PC commands close transaction on
+ * primary.
+ */
+ else if (is_2pc_transaction_query(node, query))
+ {
+ if (close_standby_transactions(frontend, backend) != POOL_CONTINUE)
+ return POOL_END;
+ }
+
+ /*
+ * If the query was not READ SELECT, remember that we had
+ * a write query in this transaction.
+ */
+ else if (!is_select_query(node, query))
+ {
+ pool_set_writing_transaction();
+ }
}
}
pool_unset_query_in_progress();
[parent: 7627c47ad246]