From: | Ajin Cherian <itsajin(at)gmail(dot)com> |
---|---|
To: | vignesh C <vignesh21(at)gmail(dot)com> |
Cc: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
Subject: | Re: 024_add_drop_pub.pl might fail due to deadlock |
Date: | 2025-07-31 10:52:26 |
Message-ID: | CAFPTHDZOdKHC1ZRpxZYVjy9q6F8VbMhrqiGOr6h=9N2Y0pDwYQ@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jul 31, 2025 at 7:07 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Thu, 31 Jul 2025 at 08:23, Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
> >
> > On Wed, Jul 30, 2025 at 10:33 PM Hayato Kuroda (Fujitsu)
> > <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> > >
> > > Dear Ajin,
> > >
> > > > Attaching the updated patches with the changes you requested. I've
> > > > also added the unchanged patches for PG_18 and HEAD (PG_18_HEAD-v6*),
> > > > so that everything is together in one mail.
> > >
> > > Thanks for update, but the patch for PG18/HEAD seemed not to have Assert().
> > > Can you modify like others do?
> > >
> >
> > Updated patch for PG18/HEAD.
>
> How about we change the below:
> +#ifdef USE_ASSERT_CHECKING
> + LOCKTAG tag;
> +#endif
> +
> + Assert(CheckRelationOidLockedByMe(SubscriptionRelRelationId,
> +
> RowExclusiveLock, true));
> +
> + rel = table_open(SubscriptionRelRelationId, NoLock);
> +#ifdef USE_ASSERT_CHECKING
> + SET_LOCKTAG_OBJECT(tag, InvalidOid,
> SubscriptionRelationId, subid, 0);
> + Assert(LockHeldByMe(&tag, AccessShareLock, true));
> +#endif
>
> to:
> #ifdef USE_ASSERT_CHECKING
> LOCKTAG tag;
> Assert(CheckRelationOidLockedByMe(SubscriptionRelRelationId,
> RowExclusiveLock, true));
> SET_LOCKTAG_OBJECT(tag, InvalidOid, SubscriptionRelationId, subid, 0);
> Assert(LockHeldByMe(&tag, AccessShareLock, true));
> #endif
>
> rel = table_open(SubscriptionRelRelationId, NoLock);
> }
>
> The rest looks good to me.
I've fixed the patches accordingly for all branches.
regards,
Ajin Cherian
Fujitsu Australia
Attachment | Content-Type | Size |
---|---|---|
PG_14_15-v8-0001-Fix-a-deadlock-during-ALTER-SUBSCRIPTION.-DROP-PU.patch | application/octet-stream | 6.0 KB |
PG_18_HEAD-v8-0001-Fix-a-possible-deadlock-during-ALTER-SUBSCRIPTION.patch | application/octet-stream | 6.4 KB |
PG_16-v8-0001-Fix-a-deadlock-during-ALTER-SUBSCRIPTION.-DROP-PU.patch | application/octet-stream | 6.0 KB |
PG_17-v8-0001-Fix-a-deadlock-during-ALTER-SUBSCRIPTION.-DROP-PU.patch | application/octet-stream | 6.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Luzanov | 2025-07-31 11:04:49 | Re: Eagerly scan all-visible pages to amortize aggressive vacuum |
Previous Message | Zhijie Hou (Fujitsu) | 2025-07-31 10:18:53 | RE: Conflict detection for update_deleted in logical replication |