postgres-github.git / summary / log / commit / refs

commit    1ff3180ca0169556984ab83759477f593129794d
Author:   Masahiko Sawada <msawada@postgresql.org>
Date:     Mon Apr 06 18:48:29 2026 +0000

    Allow autovacuum to use parallel vacuum workers.
    
    Previously, autovacuum always disabled parallel vacuum regardless of
    the table's index count or configuration. This commit enables
    autovacuum workers to use parallel index vacuuming and index cleanup,
    using the same parallel vacuum infrastructure as manual VACUUM.
    
    Two new configuration options control the feature. The GUC
    autovacuum_max_parallel_workers sets the maximum number of parallel
    workers a single autovacuum worker may launch; it defaults to 0,
    preserving existing behavior unless explicitly enabled. The per-table
    storage parameter autovacuum_parallel_workers provides per-table
    limits. A value of 0 disables parallel vacuum for the table, a
    positive value caps the worker count (still bounded by the GUC), and
    -1 (the default) defers to the GUC.
    
    To handle cases where autovacuum workers receive a SIGHUP and update
    their cost-based vacuum delay parameters mid-operation, a new
    propagation mechanism is added to vacuumparallel.c. The leader stores
    its effective cost parameters in a DSM segment. Parallel vacuum
    workers poll for changes in vacuum_delay_point(); if an update is
    detected, they apply the new values locally via VacuumUpdateCosts().
    
    A new test module, src/test/modules/test_autovacuum, is added to
    verify that parallel autovacuum workers are correctly launched and
    that cost-parameter updates are propagated as expected.
    
    The patch was originally proposed by Maxim Orlov, but the
    implementation has undergone significant architectural changes
    since then during the review process.
    
    Author: Daniil Davydov <3danissimo@gmail.com>
    Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
    Reviewed-by: Sami Imseih <samimseih@gmail.com>
    Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
    Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
    Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
    Reviewed-by: zengman <zengman@halodbtech.com>
    Discussion: https://postgr.es/m/CACG=ezZOrNsuLoETLD1gAswZMuH2nGGq7Ogcc0QOE5hhWaw=cw@mail.gmail.com

[parent: c0b53ec06309]