pgpool2.git / summary / log / commit / refs
commit 8b472278ecea9bb3cd01af2ae42ae530f80c85ee
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Thu Jun 25 23:36:20 2020 +0000
Fix load balance in snapshot isolation mode.
Commit:6f35af7485732bebec33c174ca7276fe5a62fc06
broke the case when SELECT is in a none read only transaction.
src/context/pool_query_context.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/context/pool_query_context.c b/src/context/pool_query_context.c
index e2d9941b8..dd75eda57 100644
--- a/src/context/pool_query_context.c
+++ b/src/context/pool_query_context.c
@@ -663,13 +663,11 @@ pool_where_to_send(POOL_QUERY_CONTEXT * query_context, char *query, Node *node)
*/
if (session_context->transaction_read_only)
{
+ /* Ok, we can load balance. We are done! */
set_load_balance_info(query_context);
+ set_virtual_master_node(query_context);
+ return;
}
-
- /* Set virtual master node according to the where_to_send map. */
- set_virtual_master_node(query_context);
-
- return;
}
else if (TSTATE(backend, MASTER_NODE_ID) == 'I')
{
@@ -695,7 +693,7 @@ pool_where_to_send(POOL_QUERY_CONTEXT * query_context, char *query, Node *node)
if (load_balance)
{
- /* Ok, we can load balance. We are don! */
+ /* Ok, we can load balance. We are done! */
set_load_balance_info(query_context);
set_virtual_master_node(query_context);
return;
[parent: 37772c5b492f]