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 *origin_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
origin_startpos = replorigin_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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy