> On 14 Jan 2025, at 05:24, lxiaogang5 <lxiaogang5@gmail.com> wrote:
> There is a logical defect in the function ReplicationSlotCreate (creating a new slot) when it internally traverses
theReplicationSlotCtl->replication_slots[max_replication_slots] array. When an available slot is found (slot = s), it
shouldbreak the current for loop. This issue still exists in the latest code, resulting in wasted CPU resources.
We could exit early, but any system which max_replication_slots set high enough
that the savings are measurable in a non-hot codepath is likely having other
performance problems as well (max_replication_slots is by default 10).
If you feel strongly about I suggest creating a patch and submitting. Also,
please don't send 6Mb images of text when simply copy/paste of the text would
have worked even better.
--
Daniel Gustafsson