Re: XID formatting and SLRU refactorings

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: XID formatting and SLRU refactorings
Дата
Msg-id CAPpHfdv=VahovNqJHBqr0ejHvx=eDuGYySC48Wcvp+GDxYLCJg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: XID formatting and SLRU refactorings  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On Sun, Dec 17, 2023 at 1:48 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=loach&dt=2023-12-16%2005%3A25%3A18
>
> TRAP: failed Assert("epoch > 0"), File: "twophase.c", Line: 969, PID: 71030
> 0xa8edcd <ExceptionalCondition+0x6d> at
> /usr/home/pgbf/buildroot/HEAD/pgsql.build/tmp_install/home/pgbf/buildroot/HEAD/inst/bin/postgres
> 0x613863 <ReadTwoPhaseFile+0x463> at
> /usr/home/pgbf/buildroot/HEAD/pgsql.build/tmp_install/home/pgbf/buildroot/HEAD/inst/bin/postgres
>
> That's the new assertion from 5a1dfde8:
>
> + * The wrap logic is safe here because the span of active xids cannot
> exceed one
> + * epoch at any given time.
> ...
> +       if (unlikely(xid > nextXid))
> +       {
> +               /* Wraparound occured, must be from a prev epoch. */
> +               Assert(epoch > 0);

Thank you for noticing this.  I did some investigations.
AdjustToFullTransactionId() uses TransamVariables->nextXid to convert
TransactionId into FullTransactionId.  However,
ProcArrayApplyRecoveryInfo() first checks two phase transactions then
updates  TransamVariables->nextXid.  Please, see the draft patch
fixing this.  I'll do further check if it has some side-effects.

------
Regards,
Alexander Korotkov

Вложения

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

Предыдущее
От: Sukhbir Singh
Дата:
Сообщение: How to get started with contribution
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Report planning memory in EXPLAIN ANALYZE