pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid dangling shared memory pointers in parallel vacuum.
Date: Thu, 15 Oct 2026 21:09:36 +0000
Message-ID: <E1xHShk-00000001mcm-3Vgt@gemulon.postgresql.org> (raw)

Avoid dangling shared memory pointers in parallel vacuum.

When a parallel vacuum failed, the leader's VacuumSharedCostBalance
and VacuumActiveNWorkers kept pointing into the parallel vacuum's DSM
segment, which is gone after the abort, until the next vacuum in the
same process reset them. Nothing in the current code reads them in the
meantime, but it's better not to leave them dangling. Reset them at
the end of vacuum(), as we already do at its start.

No backpatch, as this doesn't fix any live problem.

Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/CALj2ACW3OY7Ex-2-aits7yhRciH20r12DHcCNf+exuweR1FcMw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e0b995e5b23116450646fd1004db4bdcdbe213e4

Modified Files
--------------
src/backend/commands/vacuum.c | 3 +++
1 file changed, 3 insertions(+)



Message-ID: <E1xHShk-00000001mcm-3Vgt@gemulon.postgresql.org>
Permalink:  ../E1xHShk-00000001mcm-3Vgt@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xHShk-00000001mcm-3Vgt@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: msawada@postgresql.org
  Subject: Re: pgsql: Avoid dangling shared memory pointers in parallel vacuum.
  In-Reply-To: <E1xHShk-00000001mcm-3Vgt@gemulon.postgresql.org>
  References: <E1xHShk-00000001mcm-3Vgt@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox