Re: [PATCH] Use bounded GIN pending-list cleanup in parallel autovacuum

From: Jingtang Zhang <mrdrivingduck(at)gmail(dot)com>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: pgsql-hackers mailing list <pgsql-hackers(at)lists(dot)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: [PATCH] Use bounded GIN pending-list cleanup in parallel autovacuum
Date: 2026-09-21 13:34:16
Message-ID: CAPsk3_C8MVu9y0JFgoJeEsiTefvrMc1mva-C8VHXD+JbExOU+A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Andrey,

Thanks for the review!

> distinguish the leader from its workers. Perhaps a comment at the
> macro definition noting that autovacuum's parallel workers return
> false would help prevent similar mistakes.

Attached is v2 with the comment you suggested for
AmAutoVacuumWorkerProcess().

> Could we cover the parallel-worker path with a test? One possible
> scenario is to pause cleanup while flushing the old tail into the main
> index, append new pending pages, and verify that cleanup leaves those
> new pages behind. The test would need to ensure that a parallel worker,
> not the leader, handles the index; otherwise it could pass without
> the fix. I have not tried this scenario yet.

For the test, I haven't found a reliable way to control the timing
without adding injection points. We need to ensure that a parallel
worker handles the index, and append new pending pages while cleanup
is flushing the old tail into the main index.

Do you have any ideas for a simpler way to test this?

---
Best regards,
Jingtang Zhang

Attachment Content-Type Size
v2-0001-Fix-GIN-pending-list-cleanup-in-parallel-autovacuum.patch application/octet-stream 6.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-09-21 13:58:08 Re: COMMENTS are not being copied in CREATE TABLE LIKE
Previous Message Sehrope Sarkuni 2026-09-21 13:17:39 Re: [PATCH] set_byte() with a count argument