From: Michael Paquier <michael@paquier.xyz>
To: shihao zhong <zhong950419@gmail.com>
Cc: azurezhao8369@gmail.com, pgsql-bugs@lists.postgresql.org, Noah Misch <noah@leadboat.com>
Subject: Re: BUG #18258: The redo of the drop db wal needs to forward the Min Recovery Point
Date: Fri, 13 Nov 2026 15:58:15 +0900
Message-ID: <avazyjRquSzSg99f@paquier.xyz> (raw)
In-Reply-To: <CAGRkXqTwa2dWjWhhVG+rWyD2BDoiOhOXsyBmk2Ym-CEV7F_1Mw@mail.gmail.com>
References: <18258-1e2fd3058dda84b0@postgresql.org>
<CAGRkXqTwa2dWjWhhVG+rWyD2BDoiOhOXsyBmk2Ym-CEV7F_1Mw@mail.gmail.com>
On Mon, Nov 09, 2026 at 10:29:45PM -0500, shihao zhong wrote:
> DROP TABLESPACE and ALTER DATABASE SET TABLESPACE have the same gap.
> The patch calls XLogFlush() before the files are removed, like
> xact_redo_commit() does. The new TAP test fails without the fix and
> passes with it.
@@ -1555,6 +1555,9 @@ tblspc_redo(XLogReaderState *record)
/* Close all smgr fds in all backends. */
WaitForProcSignalBarrier(EmitProcSignalBarrier(PROCSIGNAL_BARRIER_SMGRRELEASE));
+ /* Update minimum recovery point first, as in dbase_redo() */
+ XLogFlush(record->EndRecPtr);
+
/*
* If we issued a WAL record for a drop tablespace it implies that
* there were no files in it at all when the DROP was done. That means
Hmm. You may be right here. I would bet that this area of the code
has already been discussed regarding this problem, but perhaps my
fuzzy memories are failing me. Did you do a search of the mailing
lists regarding that?
I was wondering if this is worth the cycles spent on to begin with,
but we already have a 033_replay_tsp_drops.pl that serves this exact
purpose, so perhaps we do.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, zhong950419@gmail.com, noah@leadboat.com
Subject: Re: BUG #18258: The redo of the drop db wal needs to forward the Min Recovery Point
In-Reply-To: <avazyjRquSzSg99f@paquier.xyz>
References: <18258-1e2fd3058dda84b0@postgresql.org> <CAGRkXqTwa2dWjWhhVG+rWyD2BDoiOhOXsyBmk2Ym-CEV7F_1Mw@mail.gmail.com> <avazyjRquSzSg99f@paquier.xyz>
* 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