pgpool2.git / summary / log / commit / refs

commit    f92b7828c41bfeee17c25a91516412da0ce4c9a0
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Fri Oct 04 04:52:19 2019 +0000

    Fix inappropriate ereport call in VALID_BACKEND.
    
    VALID_BACKEND (more precisely pool_virtual_master_db_node_id) macro
    emitted message if pgpool is performing failover/failback:
    
    ereport(WARNING,
    		(errmsg("failover/failback is in progress"),
    				errdetail("executing failover or failback on backend"),
    		 errhint("In a moment you should be able to reconnect to the database")));
    
    This could be called within signal handlers and
    POOL_SETMASK(&BlockSig)/POOL_SETMASK(&UnBlockSig) was called to block
    an interrupt because ereport is not reentrant. However it is possible
    that callers have already called POOL_SETMASK, and this could result
    unwanted signal unblock.
    
    Fix is, removing ereport and POOL_SETAMASK all together. This results
    in removing the message above but we have no choice.
    
    I found the problem while investigating regression
    055.backend_all_down failure but of course the bug could have bitten
    users in other places.


src/context/pool_query_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/context/pool_query_context.c b/src/context/pool_query_context.c index 6fe6576a9..a75ea7443 100644 --- a/src/context/pool_query_context.c +++ b/src/context/pool_query_context.c @@ -317,12 +317,14 @@ pool_virtual_master_db_node_id(void) */ if (Req_info->switching) { +#ifdef NOT_USED POOL_SETMASK(&BlockSig); ereport(WARNING, (errmsg("failover/failback is in progress"), errdetail("executing failover or failback on backend"), errhint("In a moment you should be able to reconnect to the database"))); POOL_SETMASK(&UnBlockSig); +#endif child_exit(POOL_EXIT_AND_RESTART); } [parent: f7eccd2f32a6]