pgsql: Handle checksumworker startup wait race - Mailing list pgsql-committers

From Daniel Gustafsson
Subject pgsql: Handle checksumworker startup wait race
Date
Msg-id E1w9XT8-0039Zc-15@gemulon.postgresql.org
Whole thread Raw
List 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@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(+)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Add tests for lock statistics, take two
Next
From: John Naylor
Date:
Subject: pgsql: Fix unportable use of __builtin_constant_p