Stop the search once the slot for replication origin is found.

In replorigin_session_setup(), we were needlessly looping for
max_replication_slots even after finding an existing slot for the origin.
This shouldn't hurt us much except for probably large values of
max_replication_slots.

Author: Antonin Houska
Discussion: http://postgr.es/m/2694.1700471273@antos
This commit is contained in:
Amit Kapila 2023-11-22 08:39:24 +05:30
parent cf359a0535
commit ff68cc6f3b
1 changed files with 1 additions and 0 deletions

View File

@ -1144,6 +1144,7 @@ replorigin_session_setup(RepOriginId node, int acquired_by)
/* ok, found slot */
session_replication_state = curstate;
break;
}