Re: [PATCH] add concurrent_abort callback for output plugin

Поиск
Список
Период
Сортировка
От Markus Wanner
Тема Re: [PATCH] add concurrent_abort callback for output plugin
Дата
Msg-id 4b7caf85-fea9-d146-4c4c-6cf53bb68982@enterprisedb.com
обсуждение исходный текст
Ответ на Re: [PATCH] add concurrent_abort callback for output plugin  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: [PATCH] add concurrent_abort callback for output plugin  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On 26.03.21 04:28, Amit Kapila wrote:
> I think as you have noted that stream_abort or rollback_prepared will
> be sent (the remaining changes in-between will be skipped) as we
> decode them from WAL

Yes, but as outlined, too late.  Multiple other transactions may get 
decoded until the decoder reaches the ROLLBACK PREPARED.  Thus, 
effectively, the output plugin currently needs to deduce that a 
transaction got aborted concurrently from one out of half a dozen other 
callbacks that may trigger right after that transaction, because it will 
only get closed properly much later.

> so it is not clear to me how it causes any delays
> as opposed to where we don't detect concurrent abort say because after
> that we didn't access catalog table.

You're assuming very little traffic, where the ROLLBACK ABORT follows 
the PREPARE immediately in WAL.  On a busy system, chances for that to 
happen are rather low.

(I think the same is true for streaming and stream_abort being sent only 
at the time the decoder reaches the ROLLBACK record in WAL.  However, I 
did not try.  Unlike 2PC, where this actually bit me.)

Regards

Markus



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Is it useful to record whether plans are generic or custom?
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Walsender may fail to send wal to the end.