Re: nbtree VACUUM's REDO routine doesn't clear page's VACUUM cycle ID

Andrey Borodin <x4mmm@yandex-team.ru>

From: "Andrey M. Borodin" <x4mmm@yandex-team.ru>
To: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-11-20T09:40:09Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Reset btpo_cycleid in nbtree VACUUM's REDO routine.


> On 15 Nov 2024, at 21:33, Peter Geoghegan <pg@bowt.ie> wrote:
> 
> Attached patch teaches btree_xlog_vacuum, nbtree VACUUM's REDO
> routine, to reset the target page's opaque->btpo_cycleid to 0. This
> makes the REDO routine match original execution, which seems like a
> good idea on consistency grounds.
> 
> I propose this for the master branch only.

The change seems correct to me: anyway cycle must be less than cycle of any future vacuum after promotion. I cannot say anything about beauty of resetting or not resetting the field.
I'd suggest renaming the field into something like "btpo_split_vaccycleid". I was aware of index vacuum backtracking, but it took me a while to build context again.


Best regards, Andrey Borodin.