On Thu, Aug 27, 2026 at 3:43 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> Thank you for taking care of it. The v3 patch looks good to me.
AI found one more gap while testing the committed fix on REL_19_STABLE at
b368bdd2. I haven't manually reviewed the code yet.
Once an autovacuum leader enters WaitForParallelWorkersToFinish(), SIGHUP
wakes its latch, but the loop only runs CHECK_FOR_INTERRUPTS(), leaving
ConfigReloadPending set. A cost-limit rebalance is not signalled at all. In
both cases, the leader does not publish changed cost parameters until the
parallel worker finishes.
The standalone reproducer uses 100 rows and two indexes, with no fixed
sleeps. Apply it to b368bdd2 and run:
make -C src/test/modules/test_autovacuum check \
PROVE_TESTS=t/002_cost_reload_while_waiting.pl
It fails with:
got: 'pending'
expected: 'processed'
The other attached patch adds an optional callback to the worker-finish
wait. Parallel autovacuum uses it to handle reloads and poll cost-limit
rebalancing every 100 ms; other callers keep the existing behavior. It also
adds tests for both cases to 001_parallel_autovacuum.pl.
With the fix, test_autovacuum passes, as do the core regression (239 tests)
and isolation (133 tests) suites.
The reproducer and fix patches are separate alternatives against b368bdd2,
not a series.
Nik