agora inbox for pgpool-committers@postgresql.orghelp / color / mirror / Atom feed
pgpool: Keep local primary_node_id when leader watchdog reports the ini 6+ messages / 1 participants [nested] [flat]
* pgpool: Keep local primary_node_id when leader watchdog reports the ini @ 2026-05-19 12:48 Tatsuo Ishii <ishii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tatsuo Ishii @ 2026-05-19 12:48 UTC (permalink / raw) To: pgpool-committers@lists.postgresql.org Keep local primary_node_id when leader watchdog reports the initial -2 sentinel. When all pgpool nodes in a cluster are stopped and started simultaneously (e.g. via an admin "restart all pgpool nodes" action), every node initializes Req_info->primary_node_id to -2 (the sentinel) and then runs find_primary_node_repeatedly() locally to discover the real primary. The watchdog elects a LEADER in parallel; the losing nodes transition to STANDBY, receive SIG_WATCHDOG_STATE_CHANGED, and call sync_backend_from_watchdog() to pull the leader's view. If the leader's own find_primary_node_repeatedly() has not finished yet, the leader serializes its still-uninitialized primary_node_id (-2) and the standby's existing protective branch only covers -1 (quarantine). The -2 falls through to the else-clause and overwrites the standby's freshly- determined valid primary_node_id with -2. sync_backend_from_watchdog() is only re-invoked on SIG_BACKEND_SYNC_REQUIRED, which is raised only on WD_FAILOVER_END. No subsequent event fires after a simultaneous restart, so the standby is stuck at -2 indefinitely. Add a guard that keeps the local primary_node_id when the leader's value is the -2 initial sentinel. Reported-by: Emond Papegaaij <emond.papegaaij@gmail.com> Reported-by: Claude Code Author: Tatsuo Ishii <ishii@postgresql.org> Discussion: https://www.postgresql.org/message-id/CAGXsc%2BZmBoLs3Mz%3DG-Bdm4JJG%2BfH1NpHfR3qVJVwW4eBKWwStQ%40ma... Backpatch-through: v4.3 Branch ------ V4_3_STABLE Details ------- https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=fff3614c1356ecdb71273588b40aba448460f... Modified Files -------------- src/main/pgpool_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgpool: Keep local primary_node_id when leader watchdog reports the ini @ 2026-05-19 12:49 Tatsuo Ishii <ishii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tatsuo Ishii @ 2026-05-19 12:49 UTC (permalink / raw) To: pgpool-committers@lists.postgresql.org Keep local primary_node_id when leader watchdog reports the initial -2 sentinel. When all pgpool nodes in a cluster are stopped and started simultaneously (e.g. via an admin "restart all pgpool nodes" action), every node initializes Req_info->primary_node_id to -2 (the sentinel) and then runs find_primary_node_repeatedly() locally to discover the real primary. The watchdog elects a LEADER in parallel; the losing nodes transition to STANDBY, receive SIG_WATCHDOG_STATE_CHANGED, and call sync_backend_from_watchdog() to pull the leader's view. If the leader's own find_primary_node_repeatedly() has not finished yet, the leader serializes its still-uninitialized primary_node_id (-2) and the standby's existing protective branch only covers -1 (quarantine). The -2 falls through to the else-clause and overwrites the standby's freshly- determined valid primary_node_id with -2. sync_backend_from_watchdog() is only re-invoked on SIG_BACKEND_SYNC_REQUIRED, which is raised only on WD_FAILOVER_END. No subsequent event fires after a simultaneous restart, so the standby is stuck at -2 indefinitely. Add a guard that keeps the local primary_node_id when the leader's value is the -2 initial sentinel. Reported-by: Emond Papegaaij <emond.papegaaij@gmail.com> Reported-by: Claude Code Author: Tatsuo Ishii <ishii@postgresql.org> Discussion: https://www.postgresql.org/message-id/CAGXsc%2BZmBoLs3Mz%3DG-Bdm4JJG%2BfH1NpHfR3qVJVwW4eBKWwStQ%40ma... Backpatch-through: v4.3 Branch ------ V4_4_STABLE Details ------- https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=0cfb6ebdc4df4362bb78ba6fba08c892dc057... Modified Files -------------- src/main/pgpool_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgpool: Keep local primary_node_id when leader watchdog reports the ini @ 2026-05-19 12:49 Tatsuo Ishii <ishii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tatsuo Ishii @ 2026-05-19 12:49 UTC (permalink / raw) To: pgpool-committers@lists.postgresql.org Keep local primary_node_id when leader watchdog reports the initial -2 sentinel. When all pgpool nodes in a cluster are stopped and started simultaneously (e.g. via an admin "restart all pgpool nodes" action), every node initializes Req_info->primary_node_id to -2 (the sentinel) and then runs find_primary_node_repeatedly() locally to discover the real primary. The watchdog elects a LEADER in parallel; the losing nodes transition to STANDBY, receive SIG_WATCHDOG_STATE_CHANGED, and call sync_backend_from_watchdog() to pull the leader's view. If the leader's own find_primary_node_repeatedly() has not finished yet, the leader serializes its still-uninitialized primary_node_id (-2) and the standby's existing protective branch only covers -1 (quarantine). The -2 falls through to the else-clause and overwrites the standby's freshly- determined valid primary_node_id with -2. sync_backend_from_watchdog() is only re-invoked on SIG_BACKEND_SYNC_REQUIRED, which is raised only on WD_FAILOVER_END. No subsequent event fires after a simultaneous restart, so the standby is stuck at -2 indefinitely. Add a guard that keeps the local primary_node_id when the leader's value is the -2 initial sentinel. Reported-by: Emond Papegaaij <emond.papegaaij@gmail.com> Reported-by: Claude Code Author: Tatsuo Ishii <ishii@postgresql.org> Discussion: https://www.postgresql.org/message-id/CAGXsc%2BZmBoLs3Mz%3DG-Bdm4JJG%2BfH1NpHfR3qVJVwW4eBKWwStQ%40ma... Backpatch-through: v4.3 Branch ------ V4_5_STABLE Details ------- https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=bd27378c2c9ac8d1a511f10bf7b8d4708f7b6... Modified Files -------------- src/main/pgpool_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgpool: Keep local primary_node_id when leader watchdog reports the ini @ 2026-05-19 12:49 Tatsuo Ishii <ishii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tatsuo Ishii @ 2026-05-19 12:49 UTC (permalink / raw) To: pgpool-committers@lists.postgresql.org Keep local primary_node_id when leader watchdog reports the initial -2 sentinel. When all pgpool nodes in a cluster are stopped and started simultaneously (e.g. via an admin "restart all pgpool nodes" action), every node initializes Req_info->primary_node_id to -2 (the sentinel) and then runs find_primary_node_repeatedly() locally to discover the real primary. The watchdog elects a LEADER in parallel; the losing nodes transition to STANDBY, receive SIG_WATCHDOG_STATE_CHANGED, and call sync_backend_from_watchdog() to pull the leader's view. If the leader's own find_primary_node_repeatedly() has not finished yet, the leader serializes its still-uninitialized primary_node_id (-2) and the standby's existing protective branch only covers -1 (quarantine). The -2 falls through to the else-clause and overwrites the standby's freshly- determined valid primary_node_id with -2. sync_backend_from_watchdog() is only re-invoked on SIG_BACKEND_SYNC_REQUIRED, which is raised only on WD_FAILOVER_END. No subsequent event fires after a simultaneous restart, so the standby is stuck at -2 indefinitely. Add a guard that keeps the local primary_node_id when the leader's value is the -2 initial sentinel. Reported-by: Emond Papegaaij <emond.papegaaij@gmail.com> Reported-by: Claude Code Author: Tatsuo Ishii <ishii@postgresql.org> Discussion: https://www.postgresql.org/message-id/CAGXsc%2BZmBoLs3Mz%3DG-Bdm4JJG%2BfH1NpHfR3qVJVwW4eBKWwStQ%40ma... Backpatch-through: v4.3 Branch ------ V4_6_STABLE Details ------- https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=89de41c0d4ba7a9276eb128e309ea4cc3a68b... Modified Files -------------- src/main/pgpool_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgpool: Keep local primary_node_id when leader watchdog reports the ini @ 2026-05-19 12:49 Tatsuo Ishii <ishii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tatsuo Ishii @ 2026-05-19 12:49 UTC (permalink / raw) To: pgpool-committers@lists.postgresql.org Keep local primary_node_id when leader watchdog reports the initial -2 sentinel. When all pgpool nodes in a cluster are stopped and started simultaneously (e.g. via an admin "restart all pgpool nodes" action), every node initializes Req_info->primary_node_id to -2 (the sentinel) and then runs find_primary_node_repeatedly() locally to discover the real primary. The watchdog elects a LEADER in parallel; the losing nodes transition to STANDBY, receive SIG_WATCHDOG_STATE_CHANGED, and call sync_backend_from_watchdog() to pull the leader's view. If the leader's own find_primary_node_repeatedly() has not finished yet, the leader serializes its still-uninitialized primary_node_id (-2) and the standby's existing protective branch only covers -1 (quarantine). The -2 falls through to the else-clause and overwrites the standby's freshly- determined valid primary_node_id with -2. sync_backend_from_watchdog() is only re-invoked on SIG_BACKEND_SYNC_REQUIRED, which is raised only on WD_FAILOVER_END. No subsequent event fires after a simultaneous restart, so the standby is stuck at -2 indefinitely. Add a guard that keeps the local primary_node_id when the leader's value is the -2 initial sentinel. Reported-by: Emond Papegaaij <emond.papegaaij@gmail.com> Reported-by: Claude Code Author: Tatsuo Ishii <ishii@postgresql.org> Discussion: https://www.postgresql.org/message-id/CAGXsc%2BZmBoLs3Mz%3DG-Bdm4JJG%2BfH1NpHfR3qVJVwW4eBKWwStQ%40ma... Backpatch-through: v4.3 Branch ------ V4_7_STABLE Details ------- https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=c8642fa27dd193da10656ddbadd5793f54d51... Modified Files -------------- src/main/pgpool_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgpool: Keep local primary_node_id when leader watchdog reports the ini @ 2026-05-19 12:49 Tatsuo Ishii <ishii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tatsuo Ishii @ 2026-05-19 12:49 UTC (permalink / raw) To: pgpool-committers@lists.postgresql.org Keep local primary_node_id when leader watchdog reports the initial -2 sentinel. When all pgpool nodes in a cluster are stopped and started simultaneously (e.g. via an admin "restart all pgpool nodes" action), every node initializes Req_info->primary_node_id to -2 (the sentinel) and then runs find_primary_node_repeatedly() locally to discover the real primary. The watchdog elects a LEADER in parallel; the losing nodes transition to STANDBY, receive SIG_WATCHDOG_STATE_CHANGED, and call sync_backend_from_watchdog() to pull the leader's view. If the leader's own find_primary_node_repeatedly() has not finished yet, the leader serializes its still-uninitialized primary_node_id (-2) and the standby's existing protective branch only covers -1 (quarantine). The -2 falls through to the else-clause and overwrites the standby's freshly- determined valid primary_node_id with -2. sync_backend_from_watchdog() is only re-invoked on SIG_BACKEND_SYNC_REQUIRED, which is raised only on WD_FAILOVER_END. No subsequent event fires after a simultaneous restart, so the standby is stuck at -2 indefinitely. Add a guard that keeps the local primary_node_id when the leader's value is the -2 initial sentinel. Reported-by: Emond Papegaaij <emond.papegaaij@gmail.com> Reported-by: Claude Code Author: Tatsuo Ishii <ishii@postgresql.org> Discussion: https://www.postgresql.org/message-id/CAGXsc%2BZmBoLs3Mz%3DG-Bdm4JJG%2BfH1NpHfR3qVJVwW4eBKWwStQ%40ma... Backpatch-through: v4.3 Branch ------ master Details ------- https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=48e1d6d3cd37e6e64f436d31df03d5a324662... Modified Files -------------- src/main/pgpool_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2026-05-19 12:49 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-05-19 12:48 pgpool: Keep local primary_node_id when leader watchdog reports the ini Tatsuo Ishii <ishii@postgresql.org> 2026-05-19 12:49 pgpool: Keep local primary_node_id when leader watchdog reports the ini Tatsuo Ishii <ishii@postgresql.org> 2026-05-19 12:49 pgpool: Keep local primary_node_id when leader watchdog reports the ini Tatsuo Ishii <ishii@postgresql.org> 2026-05-19 12:49 pgpool: Keep local primary_node_id when leader watchdog reports the ini Tatsuo Ishii <ishii@postgresql.org> 2026-05-19 12:49 pgpool: Keep local primary_node_id when leader watchdog reports the ini Tatsuo Ishii <ishii@postgresql.org> 2026-05-19 12:49 pgpool: Keep local primary_node_id when leader watchdog reports the ini Tatsuo Ishii <ishii@postgresql.org>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox