[pgpool-general: 8047] Re: invalid read kind

Tatsuo Ishii ishii at sraoss.co.jp
Sat Mar 12 13:21:10 JST 2022


> Hi all,
> 
> [this is a repost from the pgsql-general mailing list, because I got no
> answers from there]
> 
> we have a setup where we use PGPOOL instances between our application
> and the main DB server. Lately there is an intermittent but annoying
> error that sometimes pops up:
> 
> 
> ERROR:  unable to parse the query
> DETAIL:  invalid read kind
> SSL SYSCALL error: EOF detected
> 
> Version numbers:
> pgpool 3.7.20
> postgresql 9.5.25
> 
> 
> Relevant part of pgpool's log:
> 
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992409-1] 2022-03-10 09:44:50: pid 8731: LOG:  statement: SELECT 'OK'
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992410-1] 2022-03-10 09:44:50: pid 8731: LOG:  DB node id: 0 backend
> pid: 29433 statement: SELECT 'OK'
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992411-1] 2022-03-10 09:44:50: pid 8731: ERROR:  unable to parse the
> query
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992411-2] 2022-03-10 09:44:50: pid 8731: DETAIL:  invalid read kind
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992412-1] 2022-03-10 09:44:50: pid 8731: LOG:  statement:  DISCARD
> ALL
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992413-1] 2022-03-10 09:44:50: pid 8731: LOG:  DB node id: 0 backend
> pid: 29433 statement:  DISCARD ALL
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992414-1] 2022-03-10 09:44:50: pid 8731: FATAL:  failed to read kind
> from backend 0
> 2022-03-10T09:44:50.000000+00:00 sanitized_hostname pgpool[8731]:
> [2992414-2] 2022-03-10 09:44:50: pid 8731: DETAIL:  kind == 0
> 
> The query does not appear to be relevant, it's well-formed and not the
> same every time.
> 
> Now, what does this mean, and how to deal with it?

It (invalid read kind) means that backend PostgreSQL returns other
than "Ready for query" message[1] after pgpool sent "Sync" message[2]
while processing extended query parse message from client. This is an
unexpected response from backend. Probably there's something wrong
happened in backend but I have no idea at this moment because I don't
have enough information:

- How can we reliably reproduce the error?
- pgpoo.conf
- PostgreSQL log

[1][2] see "Frontend/backend protocol" chapter of the PostgreSQL
manual for more details.

BTW, postgresql 9.5.25 was released long time ago and it has not been
maintained any more. Many bugs and security issues have been fixed
since then. I would suggest to upgrade to more recent version of
PostgreSQL.

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


More information about the pgpool-general mailing list