public inbox for [email protected]  
help / color / mirror / Atom feed
About pgpool failover / switchover
3+ messages / 2 participants
[nested] [flat]

* About pgpool failover / switchover
@ 2025-09-12 03:43 Macao Tom <[email protected]>
  2025-09-17 01:13 ` Re: About pgpool failover / switchover Koshino Taiki <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Macao Tom @ 2025-09-12 03:43 UTC (permalink / raw)
  To: [email protected]

Dear pgpool,

I built up a postgresql 17.6.2 3 nodes cluster with 3 pgpool 4.6.2 , when I
try to switch over using “pcp_promote_start -s …..” it seems other standy
nodes can not follow the new primary node. However, after I remove the
“postgres.auto.conf” in each server and switch over using the same command
again, it works. I have also check what store in “postgres.auto.conf”, it
may store many config like “primary_conn_info” which connect to the old
primary.

Do you have any idea about this? Or do you know what mechanism cause
postgres store the old primary info in “postgres.auto.config” file?

Best regards,
Terence


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: About pgpool failover / switchover
  2025-09-12 03:43 About pgpool failover / switchover Macao Tom <[email protected]>
@ 2025-09-17 01:13 ` Koshino Taiki <[email protected]>
  2025-09-17 01:17   ` Re: About pgpool failover / switchover Macao Tom <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Koshino Taiki @ 2025-09-17 01:13 UTC (permalink / raw)
  To: Macao Tom <[email protected]>; +Cc: [email protected] <[email protected]>

This is because, when a failover or switchover occurs and the primary changes, Pgpool-II updates $PGDATA/myrecovery.conf instead of postgresql.auto.conf.

When a standby connects to the primary, it refers to the information in postgresql.auto.conf , if the setting exists there.
However, during failover or switchover, Pgpool-II updates $PGDATA/myrecovery.conf rather than postgresql.auto.conf.
As a result, postgresql.auto.conf still contains outdated connection information, causing PostgreSQL to attempt to connect using this wrong information, which leads to connection failures.

In this case, by deleting postgresql.auto.conf, the primary_conninfo in $PGDATA/myrecovery.conf was used, which was correct, so the connection succeeded.

Since having primary_conninfo in postgresql.auto.conf can sometimes prevent proper connections, it is generally recommended not to include primary_conninfo in postgresql.auto.conf.

Taiki Koshino<[email protected]>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

________________________________
差出人: Macao Tom <[email protected]>
送信日時: 2025年9月12日 12:43
宛先: [email protected] <[email protected]>
件名: About pgpool failover / switchover

Dear pgpool,

I built up a postgresql 17.6.2 3 nodes cluster with 3 pgpool 4.6.2 , when I try to switch over using “pcp_promote_start -s …..” it seems other standy nodes can not follow the new primary node. However, after I remove the “postgres.auto.conf” in each server and switch over using the same command again, it works. I have also check what store in “postgres.auto.conf”, it may store many config like “primary_conn_info” which connect to the old primary.

Do you have any idea about this? Or do you know what mechanism cause postgres store the old primary info in “postgres.auto.config” file?

Best regards,
Terence


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: About pgpool failover / switchover
  2025-09-12 03:43 About pgpool failover / switchover Macao Tom <[email protected]>
  2025-09-17 01:13 ` Re: About pgpool failover / switchover Koshino Taiki <[email protected]>
@ 2025-09-17 01:17   ` Macao Tom <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Macao Tom @ 2025-09-17 01:17 UTC (permalink / raw)
  To: Koshino Taiki <[email protected]>; +Cc: [email protected] <[email protected]>

Dear koshino,

I discover that I add “-R” in the basebackup command in recovery_1st_stage
script, this action will lead postgre generate some information into
postgre.auto.conf, therefore it success to switch over after I delete it.

Thanks for your help.

Best regards,
Terence

On Wed, 17 Sep 2025 at 09:13, Koshino Taiki <[email protected]> wrote:

> This is because, when a failover or switchover occurs and the primary
> changes, Pgpool-II updates $PGDATA/myrecovery.conf instead of
> postgresql.auto.conf.
>
> When a standby connects to the primary, it refers to the information in
> postgresql.auto.conf , if the setting exists there.
> However, during failover or switchover, Pgpool-II updates
> $PGDATA/myrecovery.conf rather than postgresql.auto.conf.
> As a result, postgresql.auto.conf still contains outdated connection
> information, causing PostgreSQL to attempt to connect using this wrong
> information, which leads to connection failures.
>
> In this case, by deleting postgresql.auto.conf, the primary_conninfo in
> $PGDATA/myrecovery.conf was used, which was correct, so the connection
> succeeded.
>
> Since having primary_conninfo in postgresql.auto.conf can sometimes
> prevent proper connections, it is generally recommended not to include
> primary_conninfo in postgresql.auto.conf.
>
> Taiki Koshino<[email protected]>
> SRA OSS K.K.
> TEL: 03-5979-2701 FAX: 03-5979-2702
> URL: https://www.sraoss.co.jp/
>
> ------------------------------
> *差出人:* Macao Tom <[email protected]>
> *送信日時:* 2025年9月12日 12:43
> *宛先:* [email protected] <
> [email protected]>
> *件名:* About pgpool failover / switchover
>
> Dear pgpool,
>
> I built up a postgresql 17.6.2 3 nodes cluster with 3 pgpool 4.6.2 , when
> I try to switch over using “pcp_promote_start -s …..” it seems other standy
> nodes can not follow the new primary node. However, after I remove the
> “postgres.auto.conf” in each server and switch over using the same command
> again, it works. I have also check what store in “postgres.auto.conf”, it
> may store many config like “primary_conn_info” which connect to the old
> primary.
>
> Do you have any idea about this? Or do you know what mechanism cause
> postgres store the old primary info in “postgres.auto.config” file?
>
> Best regards,
> Terence
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-09-17 01:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-12 03:43 About pgpool failover / switchover Macao Tom <[email protected]>
2025-09-17 01:13 ` Koshino Taiki <[email protected]>
2025-09-17 01:17   ` Macao Tom <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox