pgpool2.git / summary / log / commit / refs

commit    0c0f5bfc64bea39acf2b5328c3b7ed8d32eeed0e
Author:   Toshihiro Kitagawa <kitagawa at sraoss.co.jp>
Date:     Fri Feb 18 13:39:46 2011 +0000

    Fix bug that /*NO LOAD BALANCE*/ doesn't work in stream mode.
    Reported by Hadadi Peter.
    Fix bug with load balance in stream mode.


pool_query_context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pool_query_context.c b/pool_query_context.c index 3168e57ed..22130da27 100644 --- a/pool_query_context.c +++ b/pool_query_context.c @@ -301,7 +301,8 @@ void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *no */ if (!strncasecmp(query, NO_LOAD_BALANCE, NO_LOAD_BALANCE_COMMENT_SZ)) { - pool_set_node_to_be_sent(query_context, REAL_MASTER_NODE_ID); + pool_set_node_to_be_sent(query_context, + MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID); return; } @@ -349,7 +350,7 @@ void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *no * transaction isolation level is not SERIALIZABLE) * we might be able to load balance. */ - if (TSTATE(backend, MASTER_NODE_ID) == 'I' || + if (TSTATE(backend, PRIMARY_NODE_ID) == 'I' || (!pool_is_writing_transaction() && !pool_is_failed_transaction() && pool_get_transaction_isolation() != POOL_SERIALIZABLE)) [parent: 5406fae9f18e]