Re: Parallel vacuum: avoid dangling shared memory pointers

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Parallel vacuum: avoid dangling shared memory pointers
Date: 2026-10-15 02:19:40
Message-ID: CALj2ACWmKeS+Q19Roc6bZqHdh3Pi1rGPXFCOVWfuc++TzCt+7w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Oct 14, 2026 at 1:31 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> > I noticed that two of the parallel vacuum's shared memory pointers
> > (VacuumSharedCostBalance and VacuumActiveNWorkers) are not reset on
> > the error path, leaving them dangling, that is, pointing to a shared
> > memory segment that is already gone, until the next vacuum runs in the
> > backend or autovacuum worker....
>
> +1 to explicitly clear these variables.
>
> Given that it doesn't cause any problems today, I think we can apply
> it only to master.

Other than keeping the version diff small, I don't have a strong
opinion on back-patching it to PG19, as it doesn't fix a bug. So
applying it on HEAD looks fine to me.

--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-10-15 02:38:55 Re: Fix pg_restore gzip stream validation (bug #19754)
Previous Message Chao Li 2026-10-15 02:16:08 Re: Fix numeric log() with an infinite value and 0<base<=1