Re: CREATE SUBSCRIPTION ... SERVER vs. pg_dump, etc.

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE SUBSCRIPTION ... SERVER vs. pg_dump, etc.
Date: 2026-08-04 21:30:18
Message-ID: 41536a9ea20c03699234c72f1050c5833972740f.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2026-08-04 at 10:07 +0000, Hayato Kuroda (Fujitsu) wrote:
> Thanks for updating the patch. While seeing 0001, I found that
> GetSubscription()
> and SubscriptionConninfo() are called without acquiring the lock for
> the
> subscription. Is there a possibility that DDL commands are executed
> concurrently
> and the cache can be invalidated in-between, thus it causes
> inconsistent results?
> I tested concurrent ALTER SUBSCRIPTION SET OWNER command in
> maybe_reread_subscription(),
> but the cache is not invalidated thus changing the owner is not
> reflected.
> Is it OK?

Can you explain in more detail the problem case? Is it unique to
server-based subscriptions?

Looking at the code it seems that invalidations can be missed if they
come between the time the catalogs are read and the time that
MySubscriptionValid is set. But I think that's a pre-existing issue --
perhaps we should start a new thread about that?

Regards,
Jeff Davis

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-08-04 21:59:58 Re: Bug: XLogReader mishandles oversized multi-page xl_tot_len (potential memory corruption)
Previous Message Bharath Rupireddy 2026-08-04 20:55:00 Re: explain plans for foreign servers