Avoid streaming the transaction which are skipped (in corner cases)

Поиск
Список
Период
Сортировка
От Dilip Kumar
Тема Avoid streaming the transaction which are skipped (in corner cases)
Дата
Msg-id CAFiTN-tHK=7LzfrPs8fbT2ksrOJGQbzywcgXst2bM9-rJJAAUg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Avoid streaming the transaction which are skipped (in corner cases)  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Re: Avoid streaming the transaction which are skipped (in corner cases)  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
During DecodeCommit() for skipping a transaction we use ReadRecPtr to
check whether to skip this transaction or not.  Whereas in
ReorderBufferCanStartStreaming() we use EndRecPtr to check whether to
stream or not. Generally it will not create a problem but if the
commit record itself is adding some changes to the transaction(e.g.
snapshot) and if the "start_decoding_at" is in between ReadRecPtr and
EndRecPtr then streaming will decide to stream the transaction where
as DecodeCommit will decide to skip it.  And for handling this case in
ReorderBufferForget() we call stream_abort().

So ideally if we are planning to skip the transaction we should never
stream it hence there is no need to stream abort such transaction in
case of skip.

In this patch I have fixed the skip condition in the streaming case
and also added an assert inside ReorderBufferForget() to ensure that
the transaction should have never been streamed.

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: Remove a unused argument from qual_is_pushdown_safe
Следующее
От: Aleksander Alekseev
Дата:
Сообщение: Re: Add 64-bit XIDs into PostgreSQL 15