[pgpool-general: 5500] Re: pgpool and erlang - request hangs

PVY balroga3 at yandex.ru
Thu May 18 19:20:53 JST 2017


Hello.

Thank you very much for your response.

I'm attaching two logs, hope there is enough info. If not, I'll do my best to provide additional data.

But, first of all, this is what I've accidentally found today:
if  pgpool has only one backend configured (which becomes, of course, a primary backend), then erlang connects without problem! This is log file pgpool-erlang-1master-ok.log
But as soon as I add a slave to the pgpool-II config, then request hangs. This is pgpool-erlang-master-slave-hang.log file

You wrote:
> Your Pgpool-II log is imcoplete. To
> invesigate the problem, I need complete Pgpool-II log: starting from
> the query issued to the point Pgpool-II hangs.

Perhaps I was not clear, pgpool-II itself is fine, it does not hang up. It's the erlang connection to pgpool that hangs.



>> Hello.

>> If  I  try to establish connection between pgpool and erlang (using pgapp library https://github.com/epgsql/pgapp  )
>> then  session  simply  hangs after erlang  client  sends command 
>> SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY($1::varchar[]) 
>> parameters: $1 = '{hstore,geometry}'
>> If erlang application connects to PgSQL server directly, then connection is established without problems.

>> However, if i connect via psql to pgpool and issue the same statement - 
>> SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY('{hstore,geometry}'::varchar[]);
>> then this request is processed normally:
>>  typname |  oid  | typarray
>> ---------+-------+----------
>>  hstore  | 19898 |    19903
>> (1 row)


>> i've turned on "debug5" messages and I can see these lines in the pgpool log when erlang library is connecting, but I have no idea what other lines are significant.
>> May 17 18:02:02 ip-172-31-20-153 [23121]: [432086-1] pgpool2 DEBUG:  decide where to send the queries
>> May 17 18:02:02 ip-172-31-20-153 [23121]: [432086-2] pgpool2 DETAIL:  destination = 2 for query= "SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY($1::varchar[])"
>> May 17 18:02:02 ip-172-31-20-153 [23121]: [432087-1] pgpool2 DEBUG:  system catalog walker, checking relation "pg_type"
>> May 17 18:02:02 ip-172-31-20-153 [23121]: [432134-1] pgpool2 DEBUG:  do_query: extended:1 query:"SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.oid = to_regclass('"pg_type"') AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'"

>> and these are lines from the log file if i run this query by hand from psql:
>> May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-1] pgpool2 DEBUG:  decide where to send the queries
>> May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-2] pgpool2 DETAIL:  destination = 2 for query= "SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY('{hstore,geometry}'::varchar[]);"
>> May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-3] pgpool2 LOCATION:  pool_query_context.c:429
>> May 17 18:12:24 ip-172-31-20-153 [23539]: [432780-1] pgpool2 DEBUG:  system catalog walker, checking relation "pg_type"
>> May 17 18:12:24 ip-172-31-20-153 [23539]: [432780-2] pgpool2 LOCATION:  pool_select_walker.c:374
>> May 17 18:12:24 ip-172-31-20-153 [23539]: [432781-1] pgpool2 DEBUG:  do_query: extended:0 query:"SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.oid = to_regclass('"pg_type"') AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'"

>> There is a difference - when request is sent from erlang, then "extended:1", but when i ru query from psql, then "extended:0". Perhaps this is important?

> Maybe. erlang seems to use "extended query", which is also used in Java.

>> I understand that it looks like the problem on the erlang library side, but perhaps you, basing on your pgpool knowledge, could suggest what is causing this incompatibility between erlang pgsql library and pgpool?
>> Perhaps this old thread has something in common with my problem: http://lists.pgfoundry.org/pipermail/pgpool-general/2011-February/003409.html ?

> Not sure. Extended query is pretty complex. Extended query users for
> Pgpool-II are mostly Java. So it is possible that erlang (or pgapp)
> reveleas new bug with Pgpool-II. Your Pgpool-II log is imcoplete. To
> invesigate the problem, I need complete Pgpool-II log: starting from
> the query issued to the point Pgpool-II hangs.

> Also please let us know what version of Pgpool-II you using exactly.

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



-- 
С уважением,
 PVY                          mailto:balroga3 at yandex.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgpool-erlang-1master-ok.log.gz
Type: application/x-gzip
Size: 6373 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20170518/33cde203/attachment.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgpool-erlang-master-slave-hang.log.gz
Type: application/x-gzip
Size: 8616 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20170518/33cde203/attachment-0001.gz>


More information about the pgpool-general mailing list