[PATCH] Use bounded GIN pending-list cleanup in parallel autovacuum - Mailing list pgsql-hackers

From Jingtang Zhang
Subject [PATCH] Use bounded GIN pending-list cleanup in parallel autovacuum
Date
Msg-id CAPsk3_DiF2i1o=JRXRk1YPVMv1VzJaCAbfiEqgwCva4=ZewVAw@mail.gmail.com
Whole thread
Responses Re: [PATCH] Use bounded GIN pending-list cleanup in parallel autovacuum
List 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

pgsql-hackers by date:

Previous
From: "ZizhuanLiu X-MAN"
Date:
Subject: Re: Optimize MCV stats for sortable types and utilize sorted-order properties
Next
From: Ziming Zhang
Date:
Subject: Re: [PATCH] Combine qual-based and NOT NULL proofs when reducing outer joins