View Issue Details

IDProjectCategoryView StatusLast Update
0000756Pgpool-IIBugpublic2022-06-16 16:38
Reporterandrei Assigned Tot-ishii  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
OSLinux OS VersionDebian bookworm 
Product Version4.3.2 
Summary0000756: invalid length of startup packet
DescriptionI have setup 2 postgresql-servers (v13.4) with (native) streaming replication and added pgPool2 with the intention of doing load balancing and providing high availability.

Everything worked out in regard to load balancing, but after rebooting the primary, it won't get marked with status 'up' when doing "SHOW POOL_NODES;":

SHOW POOL_NODES;
 node_id | hostname | port | status | pg_status | lb_weight | role | pg_role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
---------+------------+------+--------+-----------+-----------+---------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
 0 | xxxxxxxxxx.2 | 5432 | down | up | 0.000000 | standby | primary | 0 | false | 0 | | | 2022-06-14 14:50:41
 1 | xxxxxxxxxx.3 | 5432 | up | up | 1.000000 | standby | standby | 0 | true | 0 | | | 2022-06-14 14:50:41


/etc/pgpool/pgpool.conf

backend_hostname0 = 'xxxxxxxx.2'
backend_port0 = 5432
backend_weight0 = 0
backend_data_directory0 = '/var/lib/pgsql/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_application_name0 = 'db01'

backend_hostname1 = 'xxxxxxxx.3'
backend_port1 = 5432
backend_weight1 = 2
backend_data_directory1 = '/var/lib/pgsql/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_application_name1 = 'db02'


When starting pgPool with the -d flag I'm getting this output:
2022-06-15 11:07:49.438: main pid 46280: LOG: find_primary_node_repeatedly: waiting for finding a primary node
2022-06-15 11:07:49.438: child pid 46313: DEBUG: initializing backend status
2022-06-15 11:07:49.438: child pid 46314: DEBUG: initializing backend status
2022-06-15 11:07:49.441: main pid 46280: DEBUG: authenticate kind = 0
2022-06-15 11:07:49.441: main pid 46280: DEBUG: authenticate backend: key data received
2022-06-15 11:07:49.441: main pid 46280: DEBUG: authenticate backend: transaction state: I
2022-06-15 11:07:49.441: main pid 46280: DEBUG: pool_acquire_follow_primary_lock: lock was not held by anyone
2022-06-15 11:07:49.441: main pid 46280: DEBUG: pool_acquire_follow_primary_lock: succeeded in acquiring lock
2022-06-15 11:07:49.441: main pid 46280: DEBUG: do_query: extended:0 query:"SELECT pg_is_in_recovery()"
2022-06-15 11:07:49.442: main pid 46280: DEBUG: do_query: extended:0 query:"SELECT current_setting('server_version_num')"
2022-06-15 11:07:49.443: main pid 46280: DEBUG: get_server_version: backend 1 server version: 130005
2022-06-15 11:07:49.443: main pid 46280: DEBUG: verify_backend_node_status: there's no primary node
2022-06-15 11:07:49.443: main pid 46280: DEBUG: pool_release_follow_primary_lock called
2022-06-15 11:07:49.443: main pid 46280: LOG: find_primary_node: standby node is 1



and postgresql primary reports:
2022-06-14 15:04:35.761 CEST [1050] [unknown]@[unknown] LOG: invalid length of startup packet



It's my first bug report so please let me know if I'm missing something.
TagsNo tags attached.

Activities

t-ishii

2022-06-16 16:38

developer   ~0004058

> Everything worked out in regard to load balancing, but after rebooting the primary, it won't get marked with status 'up' when doing "SHOW POOL_NODES;":
I assume that you do not start pgpool with "-D" option.
In this case it is possible pgpool found "pool_status" file (usually located under "logdir" of pgpool.conf directive) and the file memorizes that node 0 is in down status (probably while rebooting the server). The file contains something like:

down
up

which means node 0 is in down status. You can:

1) use pcp_attach_node command to "attach" node 0. This should bring node 0 back to online again.

2) edit the file to change "down" to "up" and restart pgpool.

Probably you want to choose 0000001 because you don't need to restart pgpool.

> and postgresql primary reports:
> 2022-06-14 15:04:35.761 CEST [1050] [unknown]@[unknown] LOG: invalid length of startup packet

I think this is irrelevant to the issue above. The time stamp is quite bit different.

Issue History

Date Modified Username Field Change
2022-06-15 18:11 andrei New Issue
2022-06-16 16:38 t-ishii Note Added: 0004058
2022-06-16 16:38 t-ishii Assigned To => t-ishii
2022-06-16 16:38 t-ishii Status new => feedback