Skip to content

Commit e42351a

Browse files
committed
Simplify some code in logical replication launcher
Avoid unnecessary locking calls when a subscription is disabled. Author: Yugo Nagata <nagata@sraoss.co.jp>
1 parent 270fec9 commit e42351a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/replication/logical/launcher.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,11 +929,14 @@ ApplyLauncherMain(Datum main_arg)
929929
Subscription *sub = (Subscription *) lfirst(lc);
930930
LogicalRepWorker *w;
931931

932+
if (!sub->enabled)
933+
continue;
934+
932935
LWLockAcquire(LogicalRepWorkerLock, LW_SHARED);
933936
w = logicalrep_worker_find(sub->oid, InvalidOid, false);
934937
LWLockRelease(LogicalRepWorkerLock);
935938

936-
if (sub->enabled && w == NULL)
939+
if (w == NULL)
937940
{
938941
last_start_time = now;
939942
wait_time = wal_retrieve_retry_interval;

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