Re: BUG #17948: libpq seems to misbehave in a pipelining corner case

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #17948: libpq seems to misbehave in a pipelining corner case
Дата
Msg-id 202312011420.zmxtoxtvu6ip@alvherre.pgsql
обсуждение исходный текст
Ответ на BUG #17948: libpq seems to misbehave in a pipelining corner case  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17948: libpq seems to misbehave in a pipelining corner case  (Ivan Trofimov <i.trofimow@yandex.ru>)
Список pgsql-bugs
On 2023-Aug-05, Трофимов Иван wrote:

>    We've managed to reproduce client <-> server de-synchronization triggered
>    by this, which we are seeing in production.
>    Libpq considers '< 2TDCEZ' a sufficient response to '> BDESS', when
>    according to specification one more 'Z' is expected.
>     
>    A bit more context and a MRE:
>    https://github.com/itrofimow/libpq_protocol_desync

Does this patch fix the problems?  I think the sync loss is because
we're consuming elements from the command queue even when we shouldn't,
because we don't know for an ERROR whether we should do so or not.  What
this patch does is a bit of a hack, I think, but it does solve your test
case (and it doesn't break anything else in the tree) AFAICS.  I may
have to play some more with it before gaining confidence, though.

Thanks

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Hay dos momentos en la vida de un hombre en los que no debería
especular: cuando puede permitírselo y cuando no puede" (Mark Twain)

Вложения

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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: BUG #17540: Prepared statement: PG switches to a generic query plan which is consistently much slower
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #18221: Unexpected Query Result