Re: About pgpool failover / switchover

From: Macao Tom <macaotom(at)gmail(dot)com>
To: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
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:17:44
Message-ID: CAPTV4vxfPs+9XrCWZb3odecCyAypKROeLvfcnw1J4jfkk45Ghw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-general

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 <koshino(at)sraoss(dot)co(dot)jp> 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<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

Browse pgpool-general by date

  From Date Subject
Next Message Bo Peng 2025-09-17 23:18:38 Re: Pgpool-II - Tcp session time out between standby nodes
Previous Message Koshino Taiki 2025-09-17 01:13:34 Re: About pgpool failover / switchover