Re: [PATCH] Fix NULL dereference in subscription REFRESH on concurrent DROP

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Fix NULL dereference in subscription REFRESH on concurrent DROP
Date: 2026-08-26 19:16:40
Message-ID: CAD21AoBnXPWWAVWcs5Q9WO1_V9R8iNhJB+XopdX1n8nCK3tVkQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 21, 2026 at 10:47 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Thu, Aug 20, 2026 at 11:13 PM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >
> > Hi,
> >
> > On Thu, Aug 20, 2026 at 5:26 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> > >
> > > Thank you for updating the patch! Here are some review comments:
> >
> > Thanks for reviewing it.
> >
> > > --- a/src/test/subscription/t/001_rep_changes.pl
> > >
> > > 100_bugs.pl seems a better place to have have this regression test.
> >
> > Agreed.
> >
> > > ---
> > > + $bg->quit;
> > > +
> > > + is($node_subscriber->safe_psql('postgres', 'SELECT 1;'),
> > > + '1', 'refresh survived a concurrently dropped table
> > > and sequence');
> > >
> > > While the background psql session survives with the proposed fix, the
> > > ALTER SUBSCRIPTION ... REFRESH command still fails since the table and
> > > sequence no longer exist on the subscriber. I think it's better to
> > > make the command done without an error.
> >
> > Ah, good catch. Yes, that's better.
> >
> > > I think we can have the regression test in v19 too as it can be added easily.
> >
> > I'm fine with it. My thinking is that for back branches, adding tests
> > for bugs makes sense as long as it doesn't introduce complexity (like
> > adding an injection point dependency for logical replication TAP
> > tests). Otherwise the fix itself is sufficient.
> >
> > > I've made some changes including the above comments and updated the
> > > commit message. I've attached the patch for HEAD. Please review it.
> >
> > The v4 patch looks good to me. pgindent, make check, and make
> > check-world are all fine.
>
> Thank you for reviewing the patch!
>
> I'll prepare patches for backbranches based on the v4 patch and push
> them early next week, barring objections.

Pushed.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Bryan Green 2026-08-26 18:44:58 Re: Fire create_upper_paths_hook for UPPERREL_PARTIAL_GROUP_AGG