pgsql: Make data checksums launcher cancel its worker at SIGINT

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make data checksums launcher cancel its worker at SIGINT
Date: 2026-08-17 20:47:05
Message-ID: E1ww4Ea-00000000xsE-2THm@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make data checksums launcher cancel its worker at SIGINT

Make sure the launcher cancels the currently running worker by calling
TerminateBackgroundWorker when it receives SIGINT. In order to handle
cases where SIGINT arrives while tje launcher is waiting for a worker
to start or exit, implement a version of WaitForBackgroundWorkerStartup
and WaitForBackgroundWorkerShutdown which checks the abort_requested
signalling. A new test which kills processing with SIGINT is added.

Backpatch to v19 where online checksums were introduced.

Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Discussion: https://postgr.es/m/CAHGQGwEQ1-+iPQnUpTXYiHmzSz9ufFVkOK4kL_uyTdYt7jgg0Q@mail.gmail.com
Backpatch-through: 19

Branch
------
master

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

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c | 112 +++++++++++++++++++---
src/test/modules/test_checksums/t/002_restarts.pl | 42 ++++++++
2 files changed, 143 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-08-17 20:47:30 pgsql: Make data checksums launcher cancel its worker at SIGINT
Previous Message Peter Eisentraut 2026-08-17 20:34:10 pgsql: Replace printf format %i by %d