Re: DROP USER MAPPING doesn't acquire lock on its server

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: DROP USER MAPPING doesn't acquire lock on its server
Date: 2026-12-04 03:43:55
Message-ID: CAGRkXqQBgEGr8ipEXSGEfsrP7=wTaOrBskoSrLxoziXokGhkmg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kirill,

Thanks for v2, it fixes all the server lookups for me. CREATE SERVER
racing with DROP FOREIGN DATA WRAPPER still fails, so maybe lock the
FDW lookup too and add a test.

> Why do we have to lock for that? I
Zsolt, I tried a single syscache lookup and CREATE FOREIGN TABLE and
CREATE SUBSCRIPTION still fail at the next lookup by OID. So I think
the lock is needed, as the comment above dependencyLockAndCheckObject()
also says. That check is already back-patched and stops orphaned rows,
so maybe this can be master only.

Regards,
Shihao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-12-04 03:47:44 Re: Standby writes pages past minRecoveryPoint after crash recovery
Previous Message Peter Smith 2026-12-04 03:20:09 Re: Show the conflict log table in \dRs+ output