public inbox for [email protected]  
help / color / mirror / Atom feed
main vs primary
5+ messages / 2 participants
[nested] [flat]

* main vs primary
@ 2025-07-29 10:32 Luca Ferrari <[email protected]>
  2025-07-30 10:03 ` Re: main vs primary Bo Peng <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Luca Ferrari @ 2025-07-29 10:32 UTC (permalink / raw)
  To: [email protected]

Hi all,
sorry for the trivial question, but I cannot find this in
documentation, so please indicate me where I can find (in case I
missed).
What is the difference between main and primary nodes?

For example, in my logs I've:

LOG:  failover: 2 follow backends have been degenerated
LOG:  failover: set new primary node: 1
LOG:  failover: set new main node: 2

in my scenario, the third host (so number 2) has been promoted. So
what is the "primary" node 1 doing?

Thanks,
Luca





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

* Re: main vs primary
  2025-07-29 10:32 main vs primary Luca Ferrari <[email protected]>
@ 2025-07-30 10:03 ` Bo Peng <[email protected]>
  2025-07-31 08:58   ` Re: main vs primary Luca Ferrari <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Bo Peng @ 2025-07-30 10:03 UTC (permalink / raw)
  To: Luca Ferrari <[email protected]>; [email protected] <[email protected]>

Hi,

The "primary node" refers to the PostgreSQL primary server in a streaming replication setup.
The "main node" indicates the main backend node, usually the first live backend (i.e., the one with the smallest node ID).
The term "main node" is typically used in native replication or snapshot isolation modes. In non-streaming replication modes, there is no primary/standby role, so Pgpool refers to the selected main backend as the "main node".

> LOG:  failover: 2 follow backends have been degenerated
> LOG:  failover: set new primary node: 1
> LOG:  failover: set new main node: 2
>
> in my scenario, the third host (so number 2) has been promoted. So
> what is the "primary" node 1 doing?

If node2 is promoted to the primary, the primary node should be shown as "node: 2".
Could you share more logs related to the failover, as well as your configuration file?

---
Bo Peng <[email protected]>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
Mobile: 080-7752-0749
URL: https://www.sraoss.co.jp/


________________________________________
差出人: Luca Ferrari <[email protected]>
送信: 2025 年 7 月 29 日 (火曜日) 19:32
宛先: [email protected] <[email protected]>
件名: main vs primary


Hi all,
sorry for the trivial question, but I cannot find this in
documentation, so please indicate me where I can find (in case I
missed).
What is the difference between main and primary nodes?

For example, in my logs I've:

LOG:  failover: 2 follow backends have been degenerated
LOG:  failover: set new primary node: 1
LOG:  failover: set new main node: 2

in my scenario, the third host (so number 2) has been promoted. So
what is the "primary" node 1 doing?

Thanks,
Luca






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

* Re: main vs primary
  2025-07-29 10:32 main vs primary Luca Ferrari <[email protected]>
  2025-07-30 10:03 ` Re: main vs primary Bo Peng <[email protected]>
@ 2025-07-31 08:58   ` Luca Ferrari <[email protected]>
  2025-07-31 12:43     ` Re: main vs primary Bo Peng <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Luca Ferrari @ 2025-07-31 08:58 UTC (permalink / raw)
  To: Bo Peng <[email protected]>; +Cc: [email protected] <[email protected]>

On Wed, Jul 30, 2025 at 12:03 PM Bo Peng <[email protected]> wrote:
>
> Hi,
>
> The "primary node" refers to the PostgreSQL primary server in a streaming replication setup.
> The "main node" indicates the main backend node, usually the first live backend (i.e., the one with the smallest node ID).

Thanks, much more clear now.

>
> > LOG:  failover: 2 follow backends have been degenerated
> > LOG:  failover: set new primary node: 1
> > LOG:  failover: set new main node: 2
> >
> > in my scenario, the third host (so number 2) has been promoted. So
> > what is the "primary" node 1 doing?
>
> If node2 is promoted to the primary, the primary node should be shown as "node: 2".
> Could you share more logs related to the failover, as well as your configuration file?
>

This is something I'm fighting from days. I've an open issue, updated
almost daily, I don't think repeating all the infor here is
appropriate but I could open a new thread if you believe it is worth.
See <https://github.com/pgpool/pgpool2/issues/118;.
In short: I've three nodes, I shutdown the first and the second gets
promoted. Failover and follow primary are fine, watchdog is happy.
Then I stop the second node, expecting the third to be promoted, and
this happens in fact. But pgpool stops working, and pcp reports the
third node as "standby primary", not "primary primary".
In particular, see behavior in
<https://github.com/pgpool/pgpool2/issues/118#issuecomment-3138977151;.

Any help is appreciated.

Thanks,
Luca





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

* Re: main vs primary
  2025-07-29 10:32 main vs primary Luca Ferrari <[email protected]>
  2025-07-30 10:03 ` Re: main vs primary Bo Peng <[email protected]>
  2025-07-31 08:58   ` Re: main vs primary Luca Ferrari <[email protected]>
@ 2025-07-31 12:43     ` Bo Peng <[email protected]>
  2025-07-31 13:25       ` Re: main vs primary Luca Ferrari <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Bo Peng @ 2025-07-31 12:43 UTC (permalink / raw)
  To: Luca Ferrari <[email protected]>; +Cc: [email protected] <[email protected]>

Hi,

Thank you for the update.

I have lool into <https://github.com/pgpool/pgpool2/issues/118;.
I think this issue might be caused by the setting "failover_when_quorum_exists = off".
I will verify the behavior and get back to you with feedback.

________________________________________
差出人: Luca Ferrari <[email protected]>
送信: 2025 年 7 月 31 日 (木曜日) 17:58
宛先: Bo Peng <[email protected]>
Cc: [email protected] <[email protected]>
件名: Re: main vs primary


On Wed, Jul 30, 2025 at 12:03 PM Bo Peng <[email protected]> wrote:
>
> Hi,
>
> The "primary node" refers to the PostgreSQL primary server in a streaming replication setup.
> The "main node" indicates the main backend node, usually the first live backend (i.e., the one with the smallest node ID).

Thanks, much more clear now.

>
> > LOG:  failover: 2 follow backends have been degenerated
> > LOG:  failover: set new primary node: 1
> > LOG:  failover: set new main node: 2
> >
> > in my scenario, the third host (so number 2) has been promoted. So
> > what is the "primary" node 1 doing?
>
> If node2 is promoted to the primary, the primary node should be shown as "node: 2".
> Could you share more logs related to the failover, as well as your configuration file?
>

This is something I'm fighting from days. I've an open issue, updated
almost daily, I don't think repeating all the infor here is
appropriate but I could open a new thread if you believe it is worth.
See <https://github.com/pgpool/pgpool2/issues/118;.
In short: I've three nodes, I shutdown the first and the second gets
promoted. Failover and follow primary are fine, watchdog is happy.
Then I stop the second node, expecting the third to be promoted, and
this happens in fact. But pgpool stops working, and pcp reports the
third node as "standby primary", not "primary primary".
In particular, see behavior in
<https://github.com/pgpool/pgpool2/issues/118#issuecomment-3138977151;.

Any help is appreciated.

Thanks,
Luca




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

* Re: main vs primary
  2025-07-29 10:32 main vs primary Luca Ferrari <[email protected]>
  2025-07-30 10:03 ` Re: main vs primary Bo Peng <[email protected]>
  2025-07-31 08:58   ` Re: main vs primary Luca Ferrari <[email protected]>
  2025-07-31 12:43     ` Re: main vs primary Bo Peng <[email protected]>
@ 2025-07-31 13:25       ` Luca Ferrari <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Luca Ferrari @ 2025-07-31 13:25 UTC (permalink / raw)
  To: Bo Peng <[email protected]>; +Cc: [email protected] <[email protected]>

On Thu, Jul 31, 2025 at 2:43 PM Bo Peng <[email protected]> wrote:
>
> I have lool into <https://github.com/pgpool/pgpool2/issues/118;.
> I think this issue might be caused by the setting "failover_when_quorum_exists = off".
> I will verify the behavior and get back to you with feedback.
>

Thank you very much.

Please note that for
<https://github.com/pgpool/pgpool2/issues/118#issuecomment-3138977151;
(last update) I was using
failover_when_quorum_exists = on

Luca






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


end of thread, other threads:[~2025-07-31 13:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-29 10:32 main vs primary Luca Ferrari <[email protected]>
2025-07-30 10:03 ` Bo Peng <[email protected]>
2025-07-31 08:58   ` Luca Ferrari <[email protected]>
2025-07-31 12:43     ` Bo Peng <[email protected]>
2025-07-31 13:25       ` Luca Ferrari <[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