Re: application_name backend (not) reporting back to the client : pgbouncer, PgSQL 16.1, pgbouncer 1.21.0

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: application_name backend (not) reporting back to the client : pgbouncer, PgSQL 16.1, pgbouncer 1.21.0
Дата
Msg-id 1552992.1702076062@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: application_name backend (not) reporting back to the client : pgbouncer, PgSQL 16.1, pgbouncer 1.21.0  (Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>)
Ответы Re: application_name backend (not) reporting back to the client : pgbouncer, PgSQL 16.1, pgbouncer 1.21.0  (Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com>)
Список pgsql-admin
Achilleas Mantzios <a.mantzios@cloud.gatewaynet.com> writes:
> the trick is to have "application_name=" with no value.  This causes the 
> server to not set application_name initially.

No, that sets it to an empty string, while application_name='' sets
it to two single quotes, according to the testing I did.  In either
case, that value will be reported to the client as the active value
during connection start.  Then the subsequent SET causes a new
report, but (since v14) only if the value being set is different.

> Please check the scenario

> Client C1 connects to S1, sets application_name. BEGINS, COMMITS, the 
> server gets freed to server the next client.

> Client C2 connects to the same S1, sets application_name, and gets no 
> report back. So it stays with application_name empty. Then this breaks 
> the application.

> How could pgbouncer prevent this from happening ?

pgbouncer would have to regurgitate the latest ParameterStatus
messages to the new client (during its faked-up initial connection
handshake) to ensure everything's synchronized correctly.
If for some reason it's not doing that, that would be a pretty
serious bug if you ask me, since clients might be relying on
hearing the truth about settings like client_encoding.  Since
the whole point of pgbouncer is that the backend doesn't know
a new client has been slotted in, it's not clear to me how or
why the backend should solve this.

            regards, tom lane



В списке pgsql-admin по дате отправления:

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Postgres storage migration
Следующее
От: Rajesh Kumar
Дата:
Сообщение: Re: Postgres storage migration