public inbox for [email protected]
help / color / mirror / Atom feedFrom: Masahiko Sawada <[email protected]>
To: shveta malik <[email protected]>
Cc: Lakshmi N <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Fix pg_upgrade to detect invalid logical replication slots on PG19
Date: Wed, 22 Apr 2026 10:01:01 -0700
Message-ID: <CAD21AoD_m+Qr8fBnHAR50XFdoYACZHw=9xotmFrUGyDG4FhwVg@mail.gmail.com> (raw)
In-Reply-To: <CAD21AoA2=3M+wAntjqTAyFUbXyHiB17Q4VU8NjZWDf+X5hXxcg@mail.gmail.com>
References: <CA+3i_M8eT6j8_cBHkYykV-SXCxbmAxpVSKptjDVq+MFtpT-Paw@mail.gmail.com>
<CAJpy0uD3Tre0jEBKZoVsxgdHQGTVTXW5hGmiOxB7TG=eWAABGw@mail.gmail.com>
<CAD21AoA2=3M+wAntjqTAyFUbXyHiB17Q4VU8NjZWDf+X5hXxcg@mail.gmail.com>
On Wed, Apr 22, 2026 at 1:02 AM Masahiko Sawada <[email protected]> wrote:
>
> On Tue, Apr 21, 2026 at 9:27 PM shveta malik <[email protected]> wrote:
> >
> > On Mon, Apr 20, 2026 at 2:28 PM Lakshmi N <[email protected]> wrote:
> > >
> > > Hi Hackers,
> > >
> > > The PG19-optimized slot catchup query uses a CTE that filters on
> > > invalidation_reason IS NULL, then cross-joins it with the main slot
> > > query. When ALL logical slots in a database are invalid, the CTE
> > > returns zero rows, and the cross join produces an empty result set.
> > > This causes pg_upgrade to silently skip those slots entirely --
> > > neither detecting them as invalid (which should block the upgrade)
> > > nor attempting to migrate them.
> > >
> > > The pre-PG19 query path does not have this problem because it queries
> > > pg_replication_slots directly without a cross join. This may not impact
> > > upgrade to PG19 but will change the behavior for PG20 upgrade.
>
> Thank you for the report.
>
> > >
> > > Fix by changing the cross join to a LEFT JOIN,
> > > so that invalid slots still appear in the result set with NULL
> > > caught_up values.
> > >
> >
> > I agree with the problem here.
>
> I've confirmed the bug and the patch fixes it. The patch looks good to
> me, so I'm going to push it tomorrow barring any objections.
Pushed.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
view thread (5+ messages)
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Fix pg_upgrade to detect invalid logical replication slots on PG19
In-Reply-To: <CAD21AoD_m+Qr8fBnHAR50XFdoYACZHw=9xotmFrUGyDG4FhwVg@mail.gmail.com>
* 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