pgsql: Handle checksumworker startup wait race

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Handle checksumworker startup wait race
Date: 2026-04-06 00:05:31
Message-ID: E1w9XT8-0039Zc-15@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)yesql(dot)seA
Reported-by: Andres Freund <andres(at)anarazel(dot)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(+)

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2026-04-06 02:31:44 pgsql: Fix unportable use of __builtin_constant_p
Previous Message Michael Paquier 2026-04-05 23:52:37 pgsql: Add tests for lock statistics, take two