Re: About pgpool failover / switchover

From: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
To: Macao Tom <macaotom(at)gmail(dot)com>
Cc: "pgpool-general(at)lists(dot)postgresql(dot)org" <pgpool-general(at)lists(dot)postgresql(dot)org>
Subject: Re: About pgpool failover / switchover
Date: 2025-09-17 01:13:34
Message-ID: TYCP286MB2926C37D1EB8D8E2D882DA819417A@TYCP286MB2926.JPNP286.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-general

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<koshino(at)sraoss(dot)co(dot)jp>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

________________________________
差出人: Macao Tom <macaotom(at)gmail(dot)com>
送信日時: 2025年9月12日 12:43
宛先: pgpool-general(at)lists(dot)postgresql(dot)org <pgpool-general(at)lists(dot)postgresql(dot)org>
件名: 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

In response to

Responses

Browse pgpool-general by date

  From Date Subject
Next Message Macao Tom 2025-09-17 01:17:44 Re: About pgpool failover / switchover
Previous Message Macao Tom 2025-09-12 03:43:07 About pgpool failover / switchover