6

I'm using pgAdmin III to manage my database from client. I have a master and a slave postgreSQL running in streaming replication mode. There's another pgpool server in front of them to do connection pooling and load-balancing.

When I was connection pgAdmin to pgpool, I got:

Error connecting to the server: ERROR: unable to read message kind
DETAIL: kind does not match between master(52) slot[1] (45)

I had no problem connecting to it before, but somehow pgpool died and I restarted it, and then this error popped up out of no where.

The pgpool and postgreSQL servers are running well. I can access them with psql -h hostname database user. The app server can also connect to it and the web app is running as usually. I just cannot access it from pgAdmin.

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
J Freebird
  • 3,664
  • 7
  • 46
  • 81

2 Answers2

2

http://www.sraoss.jp/pipermail/pgpool-general/2012-March/000297.html

In short: max_connections is exceeded on postgres cluster.

What I assume has happened - you restarted pgpool and it opened new connections to postgres, while old ones left in idle or idle in transaction (depending on timeout). So after restarting pgpool it consumed double amount of num_init_children and reached actual allowed maximum.

Killing old (before restart) pgpool connections should fix it. Try pg_terminate_backend(pid) run on postgres in order to do it. Also be carefull to kill right connections. At least check

select pid,query, client_address 
from pg_stat_activity where now()-query_start > '1 day'::interval

or alike to catch only zombies

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
0

Clear pgAdmin Cache

Close pgAdmin. Navigate to the directory where pgAdmin keeps its configuration and cache files. This location could vary depending on your operating system. Delete or move the cache files or folders related to pgAdmin. Restart pgAdmin and try connecting again.