pgpool2.git / summary / log / commit / refs

commit    6b757807196dde66e21a28c09caa4d1d68bed4c2
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Mon Feb 26 08:01:50 2018 +0000

    Revert "Fix pgpool child process segfault when ALWAYS_MASTER is on."
    
    This reverts commit 9022ff842fb5dbbe06e2f2f4cf38fadf47b592da.
    
    With the commit, write queries are always sent to node 0 even if the
    primary node is not 0 because PRIMARY_NODE_ID macro returns
    REAL_MASTER_NODE_ID, which is usually 0. Thus write queries are failed
    with:
    ERROR:  cannot execute INSERT in a read-only transaction


src/include/pool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/pool.h b/src/include/pool.h index 16d03a475..48cd82909 100644 --- a/src/include/pool.h +++ b/src/include/pool.h @@ -333,7 +333,7 @@ extern int my_master_node_id; * mode or there's no primary node, this macro returns * REAL_MASTER_NODE_ID. */ -#define PRIMARY_NODE_ID (Req_info->primary_node_id >=0 && VALID_BACKEND(Req_info->primary_node_id) ? \ +#define PRIMARY_NODE_ID (Req_info->primary_node_id >=0?\ Req_info->primary_node_id:REAL_MASTER_NODE_ID) #define IS_PRIMARY_NODE_ID(node_id) (node_id == PRIMARY_NODE_ID) [parent: 073465bb2551]