Stop the search once replication origin is found - Mailing list pgsql-hackers

From Antonin Houska
Subject Stop the search once replication origin is found
Date
Msg-id 2694.1700471273@antos
Whole thread Raw
Responses Re: Stop the search once replication origin is found
List pgsql-hackers
Although it's not performance-critical, I think it just makes sense to break
the loop in replorigin_session_setup() as soon as we've found the origin.

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com

diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index b0255ffd25..460e3dcc38 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -1144,6 +1144,7 @@ replorigin_session_setup(RepOriginId node, int acquired_by)
 
         /* ok, found slot */
         session_replication_state = curstate;
+        break;
     }
 


pgsql-hackers by date:

Previous
From: "Andrey M. Borodin"
Date:
Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Next
From: "a.rybakina"
Date:
Subject: Re: POC, WIP: OR-clause support for indexes