Re: cleaning up a few CLOG-related things

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: cleaning up a few CLOG-related things
Дата
Msg-id CA+TgmoZJcLbJTdD3X-oNMrU5BxqRvLch4yYCbS-G2dUsxh0peA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: cleaning up a few CLOG-related things  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: cleaning up a few CLOG-related things  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
On Mon, Jan 25, 2021 at 2:11 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> > [patches 0001 - 0003]
>
> Makes sense.

Great. I committed the first one and will proceed with those as well.

> > So, the CLOG page gets created when nextXid advances from the first
> > value on the page to the second value on the page, not when it
> > advances from the last value on the previous page to the first value
> > on the current page.
> Yes. It took me a moment to understand that explanation, though. I'd
> phrase it something like "nextXid is the next XID that will be used, but
> we want to set latest_page_number according to the last XID that's
> already been used. So retreat by one."

OK, updated the patch to use that language for the comment.

> Having a separate FullTransactionIdToLatestPageNumber() function for
> this seems like overkill to me.

I initially thought so too, but it turned out to be pretty useful for
writing debugging cross-checks and things, so I'm inclined to keep it
even though I'm not at present proposing to commit any such debugging
cross-checks. For example I tried making the main redo loop check
whether XactCtl->shared->latest_page_number ==
FullTransactionIdToLatestPageNumber(nextXid) which turned out to be
super-helpful in understanding things.

-- 
Robert Haas
EDB: http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Printing backtrace of postgres processes
Следующее
От: Jacob Champion
Дата:
Сообщение: Re: Support for NSS as a libpq TLS backend