tablecmds: Open pg_class only when an update is required - Mailing list pgsql-hackers

From Chao Li
Subject tablecmds: Open pg_class only when an update is required
Date
Msg-id CAEoWx2k6EKSxpYuh8BJOSDiWqOsyi65C0TSwN0vAutnZ+o617g@mail.gmail.com
Whole thread Raw
Responses Re: tablecmds: Open pg_class only when an update is required
List pgsql-hackers
Hi Hackers,

I just noticed that relation_mark_replica_identity() unconditionally opened pg_class with RowExclusiveLock even in cases where relreplident has no change, which incurred unnecessary relation opens, lock acquisition.

I just made a tiny refactor that defers opening pg_class until we know that an update to relreplident is required.

I have manually tested the change, and "make check" passed.

Best regards,
Chao Li (Evan)
---------------------
HighGo Software Co., Ltd.
https://www.highgo.com/
Attachment

pgsql-hackers by date:

Previous
From: "Xueyu Gao"
Date:
Subject: Re:Re: Propose: Adding a '--enable-failover' option to 'pg_createsubscriber' ver.3
Next
From: Bertrand Drouvot
Date:
Subject: Re: Mark function arguments of type "T *" as "const T *" where possible