Re: parallel workers and client encoding

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: parallel workers and client encoding
Дата
Msg-id fa5b0765-9f62-ec4e-6be1-314971be31e1@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: parallel workers and client encoding  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: parallel workers and client encoding  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 6/10/16 2:08 PM, Peter Eisentraut wrote:
> On 6/6/16 9:45 PM, Peter Eisentraut wrote:
>> Attached is a patch to illustrates how this could be fixed.  There might
>> be similar issues elsewhere.  The notification propagation in particular
>> could be affected.
>
> Tracing the code, NotificationResponse messages are converted to the
> client encoding during transmission from the worker to the leader and
> then sent on binarily to the client, so this should appear to work at
> the moment.  But it will break if we make a change like I suggested,
> namely changing the client encoding in the worker process to be the
> server encoding, because then nothing will transcode it before it
> reaches the client anymore.  So this will need a well-considered
> solution in concert with the error/notice issue.
>
> Then again, it's not clear to me under what circumstances a parallel
> worker could or should be sending a NotificationResponse.

Modulo that last point, here is a patch that shows how I think this
could work, in combination with the patch I posted previously that sets
the "client encoding" in the parallel worker to the server encoding.

This patch disassembles the NotificationResponse message with a
temporary client encoding, and then sends it off to the real frontend
using the real client encoding.

Doing it this way also takes care of a few special cases that
NotifyMyFrontEnd() handles, such as a client with protocol version 2
that doesn't expect a payload in the message.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Haribabu Kommi
Дата:
Сообщение: Re: WIP: Data at rest encryption
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: parallel workers and client encoding