Re: [PATCH] Writing changes of decoding plugin in the memory context where data is kept?

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Writing changes of decoding plugin in the memory context where data is kept?
Дата
Msg-id CAB7nPqT+1fHBSgbJwz7qjt0G_-n_VP+iVoyGMTh7qsip08BaaA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Writing changes of decoding plugin in the memory context where data is kept?  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On Thu, May 15, 2014 at 9:18 AM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2014-05-15 09:11:15 +0900, Michael Paquier wrote:
>> When working on a decoder plugin, I have been pointed that it is
>> incorrect to write changes in an output plugin while not being in the
>> memory context where changes are written.
>
> That was a misunderstanding. It's perfectly alright to do so. The 'bug'
> you have is that you sometimes wrote empty messages. Which
> pg_recvlogical doesn't accept. There's little reason to allow doing so,
> but for consistency we could probably ok to allow it.
Yeah, thanks. Pushed a fix. Also I imagine that this is not really a
problem, but is there an impact on the plugin if
OutputPluginPrepareWrite is called and OutputPluginWrite is not for a
single change? By looking at the code I am guessing that we use
WalSndPrepareWrite for a plugin to prepare a message, and then
WalSndWriteData to finish the work, so we end up with an empty message
that is not sent to the backend. It doesn't matter much for
test_decoding as it always writes a change, but shouldn't we
discourage users to do so in the documentation? Something like a
big-fat warning mentioning that using OutputPluginPrepareWrite called
without OutputPluginWrite may result in stall messages stuck in the
queue?
-- 
Michael



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: buildfarm / handling (undefined) locales
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Freezing without write I/O