[pgpool-general: 7655] Re: pcp_node_info shows different status on leader and standby

Bo Peng pengbo at sraoss.co.jp
Fri Jul 30 22:33:27 JST 2021


> Hello,
> 
> in my setup I use two servers. Each one runs a PostgreSQL 12.7 and a 
> pgpool-II 4.2.3 instance. Databases use streaming replication.
> 
> The pcp_node_info shows different results on leader and standby. On the 
> server with leader role I get the expected result:
> 
>         node 0: Status: 2       Status Name: up Role: primary Replication 
> State:
>         node 1: Status: 2       Status Name: up Role: standby Replication 
> State: streaming
> 
> On the server which runs pgpool-II as standby I get:
> 
>         node 0: Status: 1       Status Name: waiting    Role: primary 
> Replication State:
>         node 1: Status: 1       Status Name: waiting    Role: standby 
> Replication State: streaming
> 
> I expected to get the same results on each server. Is something going 
> wrong or haven't I read the documentation too fast?

It is a normal behaviour.

Status 1: Node is up. No connections yet
Status 2: Node is up. Connections are pooled. 

For example, you have two pgpool nodes are: pgpool 1 and pgpool 2.

Because the pgpool 2 doesn't have pooled connections to PostgreSQL,
the status shows "1 waiting".

After you connect PostgreSQL via pgpool 2,
the status will change from "waiting" to "up".

For example:

First, the status is "waiting".

  $ pcp_node_info -h 127.0.0.1 -p 50005 -n 0
  /tmp 51000 1 0.500000 waiting primary 0   2021-07-30 22:09:55

Then connect to PostgreSQL via pgpool 2.

  $ psql -h 127.0.0.1 -U pengbo test -p 50004 -c "select 1"

Run pcp_node_info again, you can see the status changed.

  $ pcp_node_info -h 127.0.0.1 -p 50005 -n 0
  /tmp 51000 2 0.500000 up primary 0   2021-07-30 22:27:55

> Best regards
> 
> Ernst Hansmair
>  ________________________________________________________
> 
> Prompt Software Systems GmbH
> Firmensitz: Salzburger Strasse 19, 83512 Wasserburg
>  
> Geschäftsführer: 
> Dipl. Bankbetriebswirt (BA) Uwe Größl,
> Ernst Hansmair,
> Dipl. Inform. Gerhard Hansmair,
> Dipl. Inform. Dr. Peter Knirsch
> Handelsregisterblatt Traunstein 5701


-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan
http://www.sraoss.co.jp/



More information about the pgpool-general mailing list