pgpool2.git / summary / log / commit / refs

commit    d95cecac8ae73e735dee30ef6697b3d1adac2d52
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Sat Mar 03 02:54:29 2012 +0000

    Fix pool_start_query() so that it uses my_master_node_id for initial
    virtual_master_node_id. Real master node could be changed while pgpool
    is running in streaming replication mode. Before it assigned
    REAL_MASTER_NODE_ID, which could have no connections after fail over
    and cause segafult because there's no connection to it.


pool_query_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool_query_context.c b/pool_query_context.c index d09a0c633..a9f393b81 100644 --- a/pool_query_context.c +++ b/pool_query_context.c @@ -98,7 +98,7 @@ void pool_start_query(POOL_QUERY_CONTEXT *query_context, char *query, int len, N query_context->original_query = query; query_context->rewritten_query = NULL; query_context->parse_tree = node; - query_context->virtual_master_node_id = REAL_MASTER_NODE_ID; + query_context->virtual_master_node_id = my_master_node_id; query_context->is_cache_safe = false; if (pool_config->memory_cache_enabled) query_context->temp_cache = pool_create_temp_query_cache(query); [parent: 2e477361cbfb]