agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid leaving DataChecksumState->worker_pid to an old value
Date: Wed, 24 Jun 2026 12:39:39 +0000
Message-ID: <E1wcMtH-0001eq-1H@gemulon.postgresql.org> (raw)

Avoid leaving DataChecksumState->worker_pid to an old value

It might be left to an old value if the launcher was terminated while
a worker was running.  launcher_exit() sends SIGTERM to the worker,
but did not clear 'worker_pid'.  Clear it, to be tidy.

Also clear it in ProcessDatabase() before starting a new datachecksums
worker, to be sure we start from a clean slate.  The codepath where
WaitForBackgroundWorkerStartup() returns BGWH_STOPPED but
worker_result != DATACHECKSUMSWORKER_SUCCESSFUL didn't clear it, while
all other codepaths did clear or set it.

Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/b283fbb9-298e-4953-9120-eefaf24fae20@iki.fi

Branch
------
master

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

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)



Message-ID: <E1wcMtH-0001eq-1H@gemulon.postgresql.org>
Permalink:  ../E1wcMtH-0001eq-1H@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wcMtH-0001eq-1H@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid leaving DataChecksumState->worker_pid to an old value
  In-Reply-To: <E1wcMtH-0001eq-1H@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox