Re: AlterSubscription_refresh "wrconn" wrong variable? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: AlterSubscription_refresh "wrconn" wrong variable?
Date
Msg-id 3984603.1620182102@sss.pgh.pa.us
Whole thread Raw
In response to Re: AlterSubscription_refresh "wrconn" wrong variable?  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: AlterSubscription_refresh "wrconn" wrong variable?
Re: AlterSubscription_refresh "wrconn" wrong variable?
List pgsql-hackers
Peter Smith <smithpb2250@gmail.com> writes:
> This patch replaces the global "wrconn" in AlterSubscription_refresh with a local variable of the same name, making
itconsistent with other functions in subscriptioncmds.c (e.g. DropSubscription). 
> The global wrconn is only meant to be used for logical apply/tablesync worker.
> Using the global/incorrect wrconn in AlterSubscription_refresh doesn't normally cause any problems, but harm is still
posslbleif the apply worker ever manages to do a subscription refresh. e.g. see [1] 

Hm.  I would actually place the blame for this on whoever thought
it was okay to name a global variable something as generic as
"wrconn".   Let's rename that while we're at it, say to something
like "tablesync_wrconn" (feel free to bikeshed).

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: MaxOffsetNumber for Table AMs
Next
From: Greg Nancarrow
Date:
Subject: Re: [bug?] Missed parallel safety checks, and wrong parallel safety