[pgpool-general: 9310] Re: pgpool Connection issue: ERROR: unable to read message kind

Tatsuo Ishii ishii at postgresql.org
Thu Jan 2 16:17:12 JST 2025


> I can able to connect directly to Postgresql (either 10.35.8.30:5432 or
> 10.35.8.31:5432), no issue with it. But when i use pgpool port 9999 then i
> see this error.

Have you set synchronous_standby_names parameter in postgresql.conf?
In my case I set it to 'server1' which is the application name set to
the standby server.

Also let's check the synchrnous streaming replication status. Can you
show the ouput of following commands?

1) connect to pgpool and run:
SHOW pool_nodes;

2) connect to primary postgres and run:
SELECT application_name,client_addr,state,sync_state FROM pg_stat_replication;

On my local environments (pgpool, PostgreSQL primary and PostgreSQL
standby are running on my laptop. pgpool port=11000, PostgreSQL primary port=11002, PostgreSQL standby port=11003)

#1:
test=# 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       | localhost | 11002 | up     | up        | 0.500000  | primary | primary | 0          | false             | 0                 |                   |                        | 2025-01-02 15:58:20
 1       | localhost | 11003 | up     | up        | 0.500000  | standby | standby | 0          | true              | 0                 | streaming         | sync                   | 2025-01-02 15:58:20
(2 rows)

#2:
test=# select application_name,client_addr,state,sync_state  from pg_stat_replication;
 application_name | client_addr |   state   | sync_state 
------------------+-------------+-----------+------------
 server1          | 127.0.0.1   | streaming | sync
(1 row)

Also I can run following command, which creates "test2" database, and
then immediately connects the newly created database "test".

t-ishii$ psql -p 11000 -c "create database test2" postgres;psql -p 11000 -c "select 1" test2
CREATE DATABASE
 ?column? 
----------
        1
(1 row)

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list