Content-Length: 290428 | pFad | http://github.com/postgrespro/postgres_cluster/commit/d4bfc06e292ee2f537f42d4ed216209c4537ee92

13 Consistently use subscription name as application name · postgrespro/postgres_cluster@d4bfc06 · GitHub
Skip to content

Commit d4bfc06

Browse files
committed
Consistently use subscription name as application name
The logical replication apply worker uses the subscription name as application name, except for table sync. This was incorrectly set to use the replication slot name, which might be different, in one case. Also add a comment why the other case is different.
1 parent 9206ced commit d4bfc06

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/backend/replication/logical/tablesync.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,11 @@ LogicalRepSyncTableStart(XLogRecPtr *origen_startpos)
817817
MySubscription->oid,
818818
MyLogicalRepWorker->relid);
819819

820+
/*
821+
* Here we use the slot name instead of the subscription name as the
822+
* application_name, so that it is different from the main apply worker,
823+
* so that synchronous replication can distinguish them.
824+
*/
820825
wrconn = walrcv_connect(MySubscription->conninfo, true, slotname, &err);
821826
if (wrconn == NULL)
822827
ereport(ERROR,

src/backend/replication/logical/worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ ApplyWorkerMain(Datum main_arg)
15951595
origen_startpos = replorigen_session_get_progress(false);
15961596
CommitTransactionCommand();
15971597

1598-
wrconn = walrcv_connect(MySubscription->conninfo, true, myslotname,
1598+
wrconn = walrcv_connect(MySubscription->conninfo, true, MySubscription->name,
15991599
&err);
16001600
if (wrconn == NULL)
16011601
ereport(ERROR,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/d4bfc06e292ee2f537f42d4ed216209c4537ee92

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy