Fix failover() to deal with the case when no former primary node exists.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sun, 6 Feb 2022 08:11:52 +0000 (17:11 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sun, 6 Feb 2022 08:25:50 +0000 (17:25 +0900)
commit04679cb67c2041c5e8fef80eb3909550ec17295e
treec198045ce88da6fbe0cb91ccb920bd28eadcd00a
parent00cf77154aedefd7f38fab5a8d7c947950175578
Fix failover() to deal with the case when no former primary node exists.

Consider a case when no primary node exists when Pgpool-II starts
up. In this case Req_info->primary_node_id is -1. failover() did not
consider this and skipped to call find_primary_node_repeatedly().
Also follow_master_command was not executed if
Req_info->primary_node_id is -1.

This commit fixes the bug above.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2022-February/004114.html
src/main/pgpool_main.c