forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4e8c0f1
committed
AlterSubscription_refresh: avoid stomping on global variable
This patch replaces use of the global "wrconn" variable inAlterSubscription_refresh with a local variable of the same name, makingit consistent with other functions in subscriptioncmds.c (e.g.DropSubscription).The global wrconn is only meant to be used for logical apply/tablesync worker.Abusing it this way is known to cause trouble if an apply workermanages to do a subscription refresh, such as reported by Jeremy Finzeland diagnosed by Andres Freund back in November 2020, athttps://www.postgresql.org/message-id/20201111215820.qihhrz7fayu6myfi@alap3.anarazel.deBackpatch to 10. In branch master, also move the connection establishmentto occur outside the PG_TRY block; this way we can remove a test for NULL inPG_FINALLY, and it also makes the code more consistent with similar code inthe same file.Author: Peter Smith <peter.b.smith@fujitsu.com>Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>Reviewed-by: Japin Li <japinli@hotmail.com>Discussion:https://postgr.es/m/CAHut+Pu7Jv9L2BOEx_Z0UtJxfDevQSAUW2mJqWU+CtmDrEZVAg@mail.gmail.com1 parent8b82de0 commit4e8c0f1
1 file changed
+9
-9
lines changedLines changed: 9 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
556 | 556 |
| |
557 | 557 |
| |
558 | 558 |
| |
| 559 | + | |
559 | 560 |
| |
560 | 561 |
| |
561 | 562 |
| |
562 | 563 |
| |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
563 | 570 |
| |
564 | 571 |
| |
565 |
| - | |
566 |
| - | |
567 |
| - | |
568 |
| - | |
569 |
| - | |
570 |
| - | |
571 | 572 |
| |
572 | 573 |
| |
573 | 574 |
| |
| |||
737 | 738 |
| |
738 | 739 |
| |
739 | 740 |
| |
740 |
| - | |
741 |
| - | |
| 741 | + | |
742 | 742 |
| |
743 | 743 |
| |
744 | 744 |
| |
| |||
1062 | 1062 |
| |
1063 | 1063 |
| |
1064 | 1064 |
| |
1065 |
| - | |
| 1065 | + | |
1066 | 1066 |
| |
1067 | 1067 |
| |
1068 | 1068 |
| |
|
0 commit comments
Comments
(0)