View Issue Details

IDProjectCategoryView StatusLast Update
0000826Pgpool-IIBugpublic2024-01-25 23:43
Reporterjerrychenhf Assigned Topengbo  
PriorityhighSeveritymajorReproducibilityalways
Status feedbackResolutionopen 
PlatformAMD64OSUbuntuOS Version20.04
Product Version4.5.0 
Summary0000826: When the first node (node with id 0) is not primary, pcp is not starting
DescriptionUse Pgpool-II to proxy 3 Postgres servers running with streaming replication.
The 3 Postgres servers are running fine and the first node (example-postgres-1.node.cloudtik) is primary and the other 2 (example-postgres-2.node.cloudtik, example-postgres-3.node.cloudtik) are hot standby.

When I configure Pgpool as following for the backend settings:

backend_hostname0=example-postgres-3.node.cloudtik
backend_port0=5432
backend_weight0=1
backend_hostname1=example-postgres-2.node.cloudtik
backend_port1=5432
backend_weight1=1
backend_hostname2=example-postgres-1.node.cloudtik
backend_port2=5432
backend_weight2=1

And start Pgpool-II service, the pool service started correctly but pcp service is not. (There is no error log saying anything error. We know the pcp process is not started by checking the pcp port is not listening)

If I change the backend configuration to assign the primary node (example-postgres-1.node.cloudtik) the node #0 and this is the only change. The pcp service started and listening.

backend_hostname0=example-postgres-1.node.cloudtik
backend_port0=5432
backend_weight0=1
backend_hostname1=example-postgres-2.node.cloudtik
backend_port1=5432
backend_weight1=1
backend_hostname2=example-postgres-3.node.cloudtik
backend_port2=5432
backend_weight2=1
Steps To ReproduceSee above description.
TagsNo tags attached.

Activities

pengbo

2024-01-25 23:43

developer   ~0004475

Pgpool PCP process starts after finding the primary node.
Below is the Logs:
------------------------------------------------
LOG: find_primary_node: standby node is 0
LOG: find_primary_node: primary node is 1
LOG: create socket files[0]: /tmp/.s.PGSQL.11001
...
LOG: PCP process: 21871 started
------------------------------------------------


If you could see the following log is repeatedly output, it means your pgpool could not find a primary node.
PCP process will start after "search_primary_node_timeout = 5min".

-------------------------------------------------
LOG: find_primary_node: standby node is ...
LOG: find_primary_node: standby node is ...
LOG: find_primary_node: standby node is ...
...
LOG: failed to find primary node
DETAIL: find_primary_node_repeatedly: expired after 300 seconds
LOG: create socket files[0]: /tmp/.s.PGSQL.11001
LOG: listen address[0]: localhost
LOG: Setting up socket for ::1:11001
LOG: Setting up socket for 127.0.0.1:11001
LOG: PCP process: 22108 started
-------------------------------------------------

If you can see the logs above, try to remove the pgpool_status file in the directory which is specified in "logdir"
and restart pgpool again.

Issue History

Date Modified Username Field Change
2024-01-25 21:31 jerrychenhf New Issue
2024-01-25 23:43 pengbo Note Added: 0004475
2024-01-25 23:43 pengbo Assigned To => pengbo
2024-01-25 23:43 pengbo Status new => feedback