pgpool2.git / summary / log / commit / refs

commit    b04fe6deafbb40135970946c22397588d2bb80f4
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Mon May 31 06:19:40 2021 +0000

    Fix occasional failure of 028.watchdog_enable_consensus_with_half_votes test.
    
    It seems the failure was caused in this scenario:
    
    Testing total nodes: 4. enable_consensus_with_half_of_the_votes: on
    shutdown node pgpool2
    2021-05-30 07:41:54: main pid 28819: LOG:  stop request sent to pgpool. waiting for termination....done.
    shutdown node pgpool1
    2021-05-30 07:41:56: main pid 28825: LOG:  stop request sent to pgpool. waiting for termination....done.
    Quorum does not exist. Test failed
    
    So the test failed at 07:41:56. In the mean time pgpool.log showed:
    2021-05-30 07:41:54: watchdog pid 28569: LOG:  We have lost the cluster leader node "localhost:50008 Linux e1aa95e1fe13"
    :
    :
    2021-05-30 07:41:59: watchdog pid 28569: LOG:  watchdog node state changed from [STANDING FOR LEADER] to [LEADER]
    2021-05-30 07:41:59: watchdog pid 28569: LOG:  I am announcing my self as leader/coordinator watchdog node
    
    The quorum was established at 07:41:59. That means the test for quorum
    existence was too early.
    
    To fix this, insert "sleep 5" after shutting down pgpool.


.../tests/028.watchdog_enable_consensus_with_half_votes/test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh b/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh index 96fb68be5..ad138b96d 100755 --- a/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh +++ b/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh @@ -69,7 +69,7 @@ function shutdown_nodes cd $cdir } -# return 0 fi nodes is even +# return 0 if nodes is even function nodes_even { test `expr $nodes % 2` = 0 @@ -110,6 +110,8 @@ do quorum_exists shutdown_nodes + sleep 5 + if quorum_exists then echo "Quorum exists. Test failed" @@ -128,6 +130,8 @@ do echo "Testing total nodes: $nodes. enable_consensus_with_half_of_the_votes: $val" shutdown_nodes + sleep 5 + if quorum_exists then if nodes_even [parent: c7f9e7ccfd77]