Re: HOT chain validation in verify_heapam()

Поиск
Список
Период
Сортировка
От Himanshu Upadhyaya
Тема Re: HOT chain validation in verify_heapam()
Дата
Msg-id CAPF61jCA+=YxxYMyYV58Ur7HBjYnxB8ZpNZO9+d5VbXQ48z7dw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: HOT chain validation in verify_heapam()  (Andres Freund <andres@anarazel.de>)
Ответы Re: HOT chain validation in verify_heapam()  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers


On Thu, Mar 23, 2023 at 2:15 AM Andres Freund <andres@anarazel.de> wrote:

Currently the new verify_heapam() follows ctid chains when XMAX_INVALID is set
and expects to find an item it can dereference - but I don't think that's
something we can rely on: Afaics HOT pruning can break chains, but doesn't
reset xmax.

We have below code which I think takes care of xmin and xmax matching and if they match then only we add them to the predecessor array.
                        /*
                         * If the next line pointer is a redirect, or if it's a tuple
                         * but the XMAX of this tuple doesn't match the XMIN of the next
                         * tuple, then the two aren't part of the same update chain and
                         * there is nothing more to do.
                         */
                        if (ItemIdIsRedirected(next_lp))
                                continue;
                        curr_htup = (HeapTupleHeader) PageGetItem(ctx.page, curr_lp);
                        curr_xmax = HeapTupleHeaderGetUpdateXid(curr_htup);
                        next_htup = (HeapTupleHeader) PageGetItem(ctx.page, next_lp);
                        next_xmin = HeapTupleHeaderGetXmin(next_htup);
                        if (!TransactionIdIsValid(curr_xmax) ||
                                !TransactionIdEquals(curr_xmax, next_xmin))
                                continue;

--
Regards,
Himanshu Upadhyaya
EnterpriseDB: http://www.enterprisedb.com

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Allow logical replication to copy tables in binary format
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: Should vacuum process config file reload more often