Fix corner case bug in Pgpool-II starting up.
authorTatsuo Ishii <ishii@postgresql.org>
Tue, 9 May 2017 23:30:17 +0000 (08:30 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Mon, 15 May 2017 22:54:13 +0000 (07:54 +0900)
commite4ce880bd36b8f249bf693c086a1313148f3449a
treec88907f95326d4b1fedf2f09d948b5e8121d7c5d
parentd54e3688aefc6cb7d04a2864fc9c2f8d09c727eb
Fix corner case bug in Pgpool-II starting up.

It is possible that a failover request is accepted before primary node
is searched.  This leads Pgpool-II to a strange state: there's no
primary node if the failed node was a primary node (even if new
primary node exists as a result of promotion of existing standby).

See [pgpool-hackers: 2321] for more details.
src/main/pgpool_main.c
src/test/regression/tests/003.failover/create_expected_node0.sql [new file with mode: 0644]
src/test/regression/tests/003.failover/test.sh
src/test/regression/tests/055.backend_all_down/test.sh