Fix occasional failure of 028.watchdog_enable_consensus_with_half_votes test.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 31 May 2021 06:19:40 +0000 (15:19 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 31 May 2021 06:19:40 +0000 (15:19 +0900)
commitb04fe6deafbb40135970946c22397588d2bb80f4
treebc2a2ed752d06357c232bc3aca4f46eba1b90652
parentc7f9e7ccfd770942fdaa081fdc93ed4a793d6536
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.
src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh