Re: 024_add_drop_pub.pl might fail due to deadlock

From: Ajin Cherian <itsajin(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 024_add_drop_pub.pl might fail due to deadlock
Date: 2025-07-22 11:58:32
Message-ID: CAFPTHDYu38w1EYU_MD+29-mdXpV2F9gCzwBYAxuKVFm6auLYBA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> locked. I've made a new version of the patch on PG_15.

I've made a similar fix on HEAD just so that the code is now
consistent. I don't think the similar problem (deadlock between two
different subscriptions trying to drop tracking origin) occurs on
HEAD with my previous patch, as the way origins are dropped are
different on HEAD. On HEAD, while dropping origin, a RowExclusiveLock
lock is taken on ReplicationOriginRelationId and then an
AccessExclusiveLock is taken on the particular origin. Since the
particular origin will be different on different subscriptions, the
similar deadlock will not happen. But just to keep code consistent, I
have made a similar fix.

regards,
Ajin Cherian
Fujitsu Australia

Attachment Content-Type Size
HEAD-v3-0001-Fix-a-possible-deadlock-during-ALTER-SUBSCRIPTION.patch application/octet-stream 7.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrei Lepikhov 2025-07-22 12:04:31 Re: track generic and custom plans in pg_stat_statements
Previous Message Matheus Alcantara 2025-07-22 11:55:56 Re: Proposal: QUALIFY clause