agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Handle checksumworker startup wait race
Date: Mon, 06 Apr 2026 00:05:31 +0000
Message-ID: <E1w9XT8-0039Zc-15@gemulon.postgresql.org> (raw)

Handle checksumworker startup wait race

If the background worker for processing databases manages to finish
before the launcher starts waiting for it, the launcher would treat
it erroneously as an error.  Fix by ensureing to check result state
in this case.  Identified on CI and synthetically reproduced during
local testing.

Also while, make sure to properly lock the shared memory structure
before updating tje result state.

Author: Daniel Gustafsson <daniel@yesql.seA
Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/4fxw37ge47v5baeozla5phymi233hxbcjbwwsfwv3mpg3kyl2z@6jk4nkf6jp4

Branch
------
master

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

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)



Message-ID: <E1w9XT8-0039Zc-15@gemulon.postgresql.org>
Permalink:  ../E1w9XT8-0039Zc-15@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w9XT8-0039Zc-15@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: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Handle checksumworker startup wait race
  In-Reply-To: <E1w9XT8-0039Zc-15@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