Content-Length: 270425 | pFad | http://github.com/postgrespro/postgres_cluster/commit/e42351ae07c19bb4eaedbdce8ccd4dfb4e905069

F6 Simplify some code in logical replication launcher · postgrespro/postgres_cluster@e42351a · GitHub
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)








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/e42351ae07c19bb4eaedbdce8ccd4dfb4e905069

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy