RE: Built-in connection pooler

From: "ideriha(dot)takeshi(at)fujitsu(dot)com" <ideriha(dot)takeshi(at)fujitsu(dot)com>
To: 'Konstantin Knizhnik' <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Ryan Lambert <ryan(at)rustprooflabs(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Dimitri Fontaine <dim(at)tapoueh(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: RE: Built-in connection pooler
Date: 2019-11-14 01:17:19
Message-ID: OSAPR01MB1985554A600901FF0B8D125FEA710@OSAPR01MB1985.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

>From: Konstantin Knizhnik [mailto:k(dot)knizhnik(at)postgrespro(dot)ru]
>>> From: Konstantin Knizhnik [mailto:k(dot)knizhnik(at)postgrespro(dot)ru]
>>>
>>> New version of builtin connection pooler fixing handling messages of
>>> extended protocol.
>>>
>> 2. When proxy_port is a bit large (perhaps more than 2^15), connection
>> failed though regular "port" is fine with number more than 2^15.
>>
>> $ bin/psql -p 32768
>> 2019-11-12 16:11:25.460 JST [5617] LOG: Message size 84
>> 2019-11-12 16:11:25.461 JST [5617] WARNING: could not setup local
>> connect to server
>> 2019-11-12 16:11:25.461 JST [5617] DETAIL: invalid port number: "-22768"
>> 2019-11-12 16:11:25.461 JST [5617] LOG: Handshake response will be
>> sent to the client later when backed is assigned
>> psql: error: could not connect to server: invalid port number: "-22768"
>Hmmm, ProxyPortNumber is used exactly in the same way as PostPortNumber.
>I was able to connect to the specified port:
>
>
>knizhnik(at)knizhnik:~/dtm-data$ psql postgres -p 42768 psql (13devel) Type "help" for
>help.
>
>postgres=# \q
>knizhnik(at)knizhnik:~/dtm-data$ psql postgres -h 127.0.0.1 -p 42768 psql (13devel)
>Type "help" for help.
>
>postgres=# \q

For now I replay for the above. Oh sorry, I was wrong about the condition.
The error occurred under following condition.
- port = 32768
- proxy_port = 6543
- $ psql postgres -p 6543

$ bin/pg_ctl start -D data
waiting for server to start....
LOG: starting PostgreSQL 13devel on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
LOG: listening on IPv6 address "::1", port 6543
LOG: listening on IPv4 address "127.0.0.1", port 6543
LOG: listening on IPv6 address "::1", port 32768
LOG: listening on IPv4 address "127.0.0.1", port 32768
LOG: listening on Unix socket "/tmp/.s.PGSQL.6543"
LOG: listening on Unix socket "/tmp/.s.PGSQL.32768"
LOG: Start proxy process 25374
LOG: Start proxy process 25375
LOG: database system was shut down at 2019-11-12 16:49:20 JST
LOG: database system is ready to accept connections

server started
[postgres(at)vm-7kfq-coreban connection-pooling]$ psql -p 6543
LOG: Message size 84
WARNING: could not setup local connect to server
DETAIL: invalid port number: "-32768"
LOG: Handshake response will be sent to the client later when backed is assigned
psql: error: could not connect to server: invalid port number: "-32768"

By the way, the patch has some small conflicts against master.

Regards,
Takeshi Ideriha

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-11-14 01:37:59 Re: Missing dependency tracking for TableFunc nodes
Previous Message Tomas Vondra 2019-11-14 00:46:31 Re: Missing dependency tracking for TableFunc nodes