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: Do not reuse rd_smgr in fork loop when enabling data checksums
Date: Tue, 04 Aug 2026 10:21:39 +0000
Message-ID: <E1wrCHD-000000009Tf-08h0@gemulon.postgresql.org> (raw)

Do not reuse rd_smgr in fork loop when enabling data checksums

ProcessSingleRelationByOid called RelationGetSmgr(rel), discarded the
result, and then read rel->rd_smgr directly when looping over forks.
Only RelationGetSmgr is authorized to read that field since a relcache
invalidation resets rd_smgr to NULL.

Backpatch to v19 where online checksums were introduced.

Author: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Reviewed-by: ChangAo Chen <cca5507@qq.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CADzfLwXGvb4Y-mqy8T+O0f_tkXR1sTDBGzP5Z=V_qcGnZ46rWg@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/01805b7d16b9a06d5223071215db0337bc8e6d92

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



view thread (2+ messages)

Message-ID: <E1wrCHD-000000009Tf-08h0@gemulon.postgresql.org>
Permalink:  ../E1wrCHD-000000009Tf-08h0@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wrCHD-000000009Tf-08h0@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: Do not reuse rd_smgr in fork loop when enabling data checksums
  In-Reply-To: <E1wrCHD-000000009Tf-08h0@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