pgsql: Fix data checksum processing for temp relations and dropped data

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix data checksum processing for temp relations and dropped data
Date: 2026-07-10 13:35:52
Message-ID: E1wiBOR-000SAJ-1o@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix data checksum processing for temp relations and dropped databases

When building the list of temporary relations to wait for, the code
previously included temporary relations without storage, such as
temporary views, even though they are irrelevant to checksum
processing. As a result, enabling data checksums could wait for a
long-lived session that owned only a temporary view.

This commit fixes the issue by filtering temporary relations with storage
only, matching the existing behavior for non-temporary relations.

Also, when enabling data checksums online, the launcher assigns the
first worker to process shared catalogs and prevents later workers from
doing so. Previously, if that worker's database was dropped after it
had been selected for processing but before checksum processing began,
the worker failed without processing the shared catalogs, yet they were
still marked as processed. As a result, later workers skipped them, and
checksum enabling could complete successfully even though the shared
catalogs had never been processed.

This commit fixes the issue by marking shared catalogs as processed
only after a worker completes successfully.

Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Reviewed-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Discussion: https://postgr.es/m/CAHGQGwGDHAQw=bmpRzk+EmKzVtxZiD5YDurMUffBMwr6WXugQA@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/97a18c221b8a71c89a68870c0c0343759b41d290

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-07-10 13:36:14 pgsql: Fix data checksum processing for temp relations and dropped data
Previous Message Fujii Masao 2026-07-10 11:38:09 pgsql: postgres_fdw: Mark statistics import helpers as static