pgpool2.git / summary / log / commit / refs
commit 19449452c98596070bd4fabdcbdf0d282a8c60ef
Author: Tatsuo Ishii <ishii at sraoss.co.jp>
Date: Thu Aug 20 06:26:58 2009 +0000
Fix possible bug introduced in pgpool-II 2.2.2.
Load balance control variables may remain not be restored
and subsequent DML/DDL call might sent to only master node.
pool_process_query.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/pool_process_query.c b/pool_process_query.c
index 1e735d0f8..87452d90b 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -2125,7 +2125,7 @@ POOL_STATUS ParameterStatus(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *bac
}
/*
- * reset backend status. return values are:
+ * Reset backend status. return values are:
* 0: no query was issued 1: a query was issued 2: no more queries remain -1: error
*/
static int reset_backend(POOL_CONNECTION_POOL *backend, int qcnt)
@@ -2138,6 +2138,17 @@ static int reset_backend(POOL_CONNECTION_POOL *backend, int qcnt)
*/
in_progress = 0;
in_load_balance = 0;
+
+ /*
+ * Until pgpool-II 2.2.3 we don't have following 2 lines.
+ * If we were executing someting in load balance mode, and if
+ * frontend failed before executing end_loadl_balance() in
+ * ReadyForQuery(), these variables remained and we may do
+ * something only in master node!
+ */
+ REPLICATION = pool_config->replication_mode;
+ MASTER_SLAVE = pool_config->master_slave_mode;
+
force_replication = 0;
internal_transaction_started = 0;
mismatch_ntuples = 0;
[parent: 48adaa369c4d]