Re: Non-blocking synchronization in libpq using pipeline mode

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Non-blocking synchronization in libpq using pipeline mode
Дата
Msg-id 202403191149.asubmjesltim@alvherre.pgsql
обсуждение исходный текст
Ответ на Non-blocking synchronization in libpq using pipeline mode  (PG Doc comments form <noreply@postgresql.org>)
Ответы Re: Non-blocking synchronization in libpq using pipeline mode  (Jan Behrens <jbe-mlist@magnetkern.de>)
Список pgsql-docs
On 2024-Mar-06, PG Doc comments form wrote:

> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/16/libpq-pipeline-mode.html
> Description:
> 
> The calls to PQpipelineSync and PQsendFlushRequest may either report failure
> or success, but not that data could not be written as of yet because the
> request would block.

Is this a literal quote?  If so, where do you see it?

> Does this mean that
> 
> 1. these functions will always block when invoked and the socket is not
> ready to accept the number of bytes that need to be written (assuming the
> number of bytes required to be written is greater than one byte)

No.

> 2. the synchronization or flush request need to be flushed manually with
> successive PQflush calls

Yes.

> or
> 
> 3. the functions will return an error condition when the connection is
> non-blocking and no data could be written.

No.

> Any clarification in the documentation would be appreciated.

So I checked https://www.postgresql.org/docs/16/libpq-pipeline-mode.html
and it has this, under PQsendFlushRequest:

   The server flushes its output buffer automatically as a result of
   PQpipelineSync being called, or on any request when not in pipeline
   mode; this function is useful to cause the server to flush its output
   buffer in pipeline mode without establishing a synchronization point.
   Note that the request is not itself flushed to the server
   automatically; use PQflush if necessary.

which I think answers what you are asking.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Just treat us the way you want to be treated + some extra allowance
 for ignorance."                                    (Michael Brusser)



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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Monetary Data Types Improvement
Следующее
От: Greg Sabino Mullane
Дата:
Сообщение: Re: Discourage splitting pg_wal directory