diff options
author | Amit Kapila <akapila@postgresql.org> | 2023-08-04 08:15:07 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2023-08-04 08:15:07 +0530 |
commit | 81ccbe520f42a9873734c614e4eb521190d8f8e4 (patch) | |
tree | e5f3f1ca453214cb1420628498d9367f293c540e /src | |
parent | 7516056c584e3f7e04269f2e80835d1433e869c4 (diff) | |
download | postgresql-81ccbe520f42a9873734c614e4eb521190d8f8e4.tar.gz postgresql-81ccbe520f42a9873734c614e4eb521190d8f8e4.zip |
Simplify some of the logical replication worker-type checks.
Author: Peter Smith
Reviewed-by: Hou Zhijie
Discussion: http://postgr.es/m/CAHut+Pv-xkEpuPzbEJ=ZSi7Hp2RoGJf=VA-uDRxLi1KHSneFjg@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/logical/worker.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index a9f5fa7dfc0..a20d4c11716 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -3863,7 +3863,7 @@ apply_worker_exit(void) * subscription is still active, and so that we won't leak that hash table * entry if it isn't. */ - if (!am_tablesync_worker()) + if (am_leader_apply_worker()) ApplyLauncherForgetWorkerStartTime(MyLogicalRepWorker->subid); proc_exit(0); @@ -3906,8 +3906,9 @@ maybe_reread_subscription(void) MySubscription->name))); /* Ensure we remove no-longer-useful entry for worker's start time */ - if (!am_tablesync_worker() && !am_parallel_apply_worker()) + if (am_leader_apply_worker()) ApplyLauncherForgetWorkerStartTime(MyLogicalRepWorker->subid); + proc_exit(0); } @@ -4589,8 +4590,9 @@ InitializeLogRepWorker(void) MyLogicalRepWorker->subid))); /* Ensure we remove no-longer-useful entry for worker's start time */ - if (!am_tablesync_worker() && !am_parallel_apply_worker()) + if (am_leader_apply_worker()) ApplyLauncherForgetWorkerStartTime(MyLogicalRepWorker->subid); + proc_exit(0); } @@ -4715,7 +4717,7 @@ DisableSubscriptionAndExit(void) CommitTransactionCommand(); /* Ensure we remove no-longer-useful entry for worker's start time */ - if (!am_tablesync_worker() && !am_parallel_apply_worker()) + if (am_leader_apply_worker()) ApplyLauncherForgetWorkerStartTime(MyLogicalRepWorker->subid); /* Notify the subscription has been disabled and exit */ |