pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix parallel worker tracking of new catalog relfilenumbers.
Date: Thu, 24 Oct 2024 16:20:26 +0000
Message-ID: <E1t40ZW-002FiA-Sd@gemulon.postgresql.org> (raw)

Fix parallel worker tracking of new catalog relfilenumbers.

Reunite RestorePendingSyncs() with RestoreRelationMap().  If
RelationInitPhysicalAddr() ran after RestoreRelationMap() but before
RestorePendingSyncs(), the relcache entry could cause RelationNeedsWAL()
to return true erroneously.  Trouble required commands of the current
transaction to include REINDEX or CLUSTER of a system catalog.  The
parallel leader correctly derived RelationNeedsWAL()==false from the new
relfilenumber, but the worker saw RelationNeedsWAL()==true.  Worker
MarkBufferDirtyHint() then wrote unwanted WAL.  Recovery of that
unwanted WAL could lose tuples like the system could before commit
c6b92041d38512a4176ed76ad06f713d2e6c01a8 introduced this tracking.
RestorePendingSyncs() and RestoreRelationMap() were adjacent till commit
126ec0bc76d044d3a9eb86538b61242bf7da6db4, so no back-patch for now.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20241019232815.c6.nmisch@google.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/67bab53d64428e4d43386be0e077cd662bc9cad3

Modified Files
--------------
src/backend/access/transam/parallel.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)



Message-ID: <E1t40ZW-002FiA-Sd@gemulon.postgresql.org>
Permalink:  ../E1t40ZW-002FiA-Sd@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t40ZW-002FiA-Sd@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: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix parallel worker tracking of new catalog relfilenumbers.
  In-Reply-To: <E1t40ZW-002FiA-Sd@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox