On Mon, Sep 28, 2026 at 9:58 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> Hi,
>
> On Sun, Sep 27, 2026 at 5:06 PM Bharath Rupireddy
> <bharath.rupireddyforpostgres@gmail.com> wrote:
> >
> > Hi,
> >
> > AI review found a bug in parallel autovacuum (1ff3180ca01). I checked
> > it myself and it reproduces on HEAD and PG19. Patch and reproducer
> > attached.
> >
> > When no DSM segment can be created, InitializeParallelDSM() does not
> > fail. It sets up the parallel context in the leader's own memory with
> > zero workers and leaves pcxt->seg NULL. Parallel query checks that
> > pointer before using it, see ExecInitParallelPlan(), and VACUUM
> > (PARALLEL) never looks at it and vacuums all the indexes in the
> > leader. Parallel autovacuum registers a DSM detach callback on it, so
> > the autovacuum worker segfaults and the database goes through crash
> > recovery. It also leaves pv_shared_cost_params pointing into the
> > leader's private memory with nothing left to reset it.
>
> Thank you for the report and the patch!
>
> I agree with your analysis and it should be fixed. The proposed patch
> is simple and looks good to me, so I'm going to push it barring any
> objections.
Pushed.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com