Обсуждение: Call pqPipelineFlush from PQsendFlushRequest

Поиск
Список
Период
Сортировка

Call pqPipelineFlush from PQsendFlushRequest

От
Jelte Fennema-Nio
Дата:
In pipeline mode after queuing a message to be sent we would flush the
buffer if the size of the buffer passed some threshold. The only message
type that we didn't do that for was the Flush message. This addresses
that oversight.

I noticed this discrepancy while reviewing the
PQsendSyncMessage/PQpipelinePutSync patchset.

Вложения

Re: Call pqPipelineFlush from PQsendFlushRequest

От
Michael Paquier
Дата:
On Tue, Nov 07, 2023 at 10:38:04AM +0100, Jelte Fennema-Nio wrote:
> In pipeline mode after queuing a message to be sent we would flush the
> buffer if the size of the buffer passed some threshold. The only message
> type that we didn't do that for was the Flush message. This addresses
> that oversight.
>
> I noticed this discrepancy while reviewing the
> PQsendSyncMessage/PQpipelinePutSync patchset.

Indeed, it looks a bit strange that there is no flush if the buffer
threshold is reached once the message is sent, so your suggestion
sounds right.  Alvaro?
--
Michael

Вложения

Re: Call pqPipelineFlush from PQsendFlushRequest

От
Alvaro Herrera
Дата:
On 2023-Nov-07, Michael Paquier wrote:

> On Tue, Nov 07, 2023 at 10:38:04AM +0100, Jelte Fennema-Nio wrote:
> > In pipeline mode after queuing a message to be sent we would flush the
> > buffer if the size of the buffer passed some threshold. The only message
> > type that we didn't do that for was the Flush message. This addresses
> > that oversight.
> > 
> > I noticed this discrepancy while reviewing the
> > PQsendSyncMessage/PQpipelinePutSync patchset.
> 
> Indeed, it looks a bit strange that there is no flush if the buffer
> threshold is reached once the message is sent, so your suggestion
> sounds right.  Alvaro?

I agree, and I intend to get this patch pushed once the release freeze
is lifted.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"The Gord often wonders why people threaten never to come back after they've
been told never to return" (www.actsofgord.com)



Re: Call pqPipelineFlush from PQsendFlushRequest

От
Michael Paquier
Дата:
On Tue, Nov 07, 2023 at 12:43:18PM +0100, Alvaro Herrera wrote:
> I agree, and I intend to get this patch pushed once the release freeze
> is lifted.

Thanks!
--
Michael

Вложения

Re: Call pqPipelineFlush from PQsendFlushRequest

От
Alvaro Herrera
Дата:
On 2023-Nov-07, Michael Paquier wrote:

> On Tue, Nov 07, 2023 at 10:38:04AM +0100, Jelte Fennema-Nio wrote:
> > In pipeline mode after queuing a message to be sent we would flush the
> > buffer if the size of the buffer passed some threshold. The only message
> > type that we didn't do that for was the Flush message. This addresses
> > that oversight.
> > 
> > I noticed this discrepancy while reviewing the
> > PQsendSyncMessage/PQpipelinePutSync patchset.
> 
> Indeed, it looks a bit strange that there is no flush if the buffer
> threshold is reached once the message is sent, so your suggestion
> sounds right.  Alvaro?

Pushed, thanks.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Porque Kim no hacía nada, pero, eso sí,
con extraordinario éxito" ("Kim", Kipling)



Re: Call pqPipelineFlush from PQsendFlushRequest

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2023-Nov-07, Michael Paquier wrote:
>> Indeed, it looks a bit strange that there is no flush if the buffer
>> threshold is reached once the message is sent, so your suggestion
>> sounds right.  Alvaro?

> Pushed, thanks.

I observe that this patch did not touch libpq.sgml, which still says

       Note that the request is not itself flushed to the server automatically;
       use <function>PQflush</function> if necessary.

Doesn't that require some rewording?

            regards, tom lane



Re: Call pqPipelineFlush from PQsendFlushRequest

От
Jelte Fennema-Nio
Дата:
On Thu, 1 Feb 2024 at 21:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>        Note that the request is not itself flushed to the server automatically;
>        use <function>PQflush</function> if necessary.
>
> Doesn't that require some rewording?

I agree that the current wording is slightly incorrect, but I think I
prefer we keep it this way. The fact that we actually DO flush when
some internal buffer is filled up seems more like an implementation
detail, than behavior that people should actually be depending upon.
And even knowing the actual behavior, still the only way to know that
your data is flushed is by calling PQflush (since a user has no way of
checking if we automatically flushed the internal buffer).