pgpool2.git / summary / log / commit / refs

commit    6971907dfcec6cfb0cf601c9020d3c31bf5da24d
Author:   Guillaume Lelarge <guillaume at lelarge.info>
Date:     Tue Jun 28 12:31:47 2011 +0000

    pgpool in raw mode is mistaken on alive nodes
    
    VALID_BACKEND macro in raw mode should not be used. So, we add a specific
    check when pgpool is running in raw mode.


main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 237a3e2c6..92bee7dfe 100644 --- a/main.c +++ b/main.c @@ -1331,7 +1331,8 @@ void send_failback_request(int node_id) Req_info->kind = NODE_UP_REQUEST; Req_info->node_id[0] = node_id; - if (node_id < 0 || node_id >= MAX_NUM_BACKENDS || VALID_BACKEND(node_id)) + if (node_id < 0 || node_id >= MAX_NUM_BACKENDS || + (RAW_MODE && BACKEND_INFO(node_id).backend_status != CON_DOWN && VALID_BACKEND(node_id))) { pool_error("send_failback_request: node %d is alive.", node_id); return; @@ -1511,7 +1512,8 @@ static void failover(void) if (Req_info->kind == NODE_UP_REQUEST) { if (node_id >= MAX_NUM_BACKENDS || - (Req_info->kind == NODE_UP_REQUEST && VALID_BACKEND(node_id)) || + (Req_info->kind == NODE_UP_REQUEST && !(RAW_MODE && + BACKEND_INFO(i).backend_status == CON_DOWN) && VALID_BACKEND(node_id)) || (Req_info->kind == NODE_DOWN_REQUEST && !VALID_BACKEND(node_id))) { pool_semaphore_unlock(REQUEST_INFO_SEM); [parent: 7fc28bc09d2f]