On Wed, Sep 30, 2026 at 2:00 AM Zsolt Parragi <zsolt.parragi@percona.com> wrote:
>
> I addressed these in v5. 0001 is unchanged.
>
> > I think we could simplify the tests by
> > introducing a boolean variable, say, leader_participates
> > ...
>
> I am not convinced that this change made things simpler, but it is
> included in 0002.
I think it did; the v5 adds 3 injection points while the v4 added 4
injection points.
>
> > While not a problem with this patch, I wish wait_for_log could either return
> > the match, or at least the offset of the match, and not just the size of the
> > file. If we had that we could avoid reading excessive amounts of log data and
> > reduce the risk of buggy tests matching on the wrong part of the log.
>
> I ended up completely removing that test, it seemed redundant.
Thinking about these regression tests, I think we can simplify them
further by using a single injection point. Instead of having the
workers process the indexes while the leader waits for them, we can
stop the worker at the beginning of parallel_vacuum_main() and have
the leader process all the indexes and wait in
WaitForParallelWorkersToFinish(). That way, we can create a situation
where the leader waits in WaitForParallelWorkersToFinish() with just
one injection point. This injection point can also be reused in the
other tests being discussed[1].
Also, instead of adding a 'parallel-autovacuum-leader-cost-updated'
injection point, the leader writes a DEBUG2 log after propagating the
shared delay params.
The attached patch implements this idea and can be applied on top of
the v5-0002 patch. It also adds more comments to these tests for
better readability.
Regards,
[1] https://www.postgresql.org/message-id/CALj2ACWK6PkOk5MTfibtJyTYpb%3DAq_8%3DYaexnPKhOj11bOCROQ%40mail.gmail.com
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com