| From: | Jingtang Zhang <mrdrivingduck(at)gmail(dot)com> |
|---|---|
| To: | pgsql-hackers(at)lists(dot)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Cc: | Peter Geoghegan <pg(at)bowt(dot)ie>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
| Subject: | [PATCH] Use bounded GIN pending-list cleanup in parallel autovacuum |
| Date: | 2026-09-20 15:39:47 |
| Message-ID: | CAPsk3_DiF2i1o=JRXRk1YPVMv1VzJaCAbfiEqgwCva4=ZewVAw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
GIN asks a manual VACUUM to empty the pending list. Autovacuum instead
stops after processing the part of the list that existed when cleanup
started. This prevents concurrent insertions from extending cleanup
indefinitely. It is safe because those insertions cannot contain TIDs
that this VACUUM needs to remove.
Parallel autovacuum workers are regular background workers, so
AmAutoVacuumWorkerProcess() returns false for them. A GIN index handled
by such a worker is therefore treated as if it were processed by a
manual VACUUM, and its pending-list cleanup is not bounded.
The attached patch adds is_autovacuum to IndexVacuumInfo and passes the
leader's state to parallel workers. GIN uses that state when deciding
whether the pending list must be emptied. Manual VACUUM behavior is
unchanged.
Any thoughts?
---
Best regards,
Jingtang Zhang
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Fix-GIN-pending-list-cleanup-in-parallel-autovacuum.patch | application/octet-stream | 5.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ziming Zhang | 2026-09-20 16:16:42 | Re: [PATCH] Combine qual-based and NOT NULL proofs when reducing outer joins |
| Previous Message | ZizhuanLiu X-MAN | 2026-09-20 14:51:58 | Re: Optimize MCV stats for sortable types and utilize sorted-order properties |