There is a defect in the ReplicationSlotCreate() function where it iterates through ReplicationSlotCtl->replication_slots[max_replication_slots] to find a slot but does not break out of the loop when a slot is found.

From: lxiaogang5 <lxiaogang5(at)gmail(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: There is a defect in the ReplicationSlotCreate() function where it iterates through ReplicationSlotCtl->replication_slots[max_replication_slots] to find a slot but does not break out of the loop when a slot is found.
Date: 2025-01-14 04:24:43
Message-ID: tencent_4F926019B88B74E2E7F51E57@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


There is a logical defect in the function ReplicationSlotCreate (creating a new slot) when it internally traverses the ReplicationSlotCtl->replication_slots[max_replication_slots] array. When an available slot is found (slot = s), it should break the current for loop. This issue still exists in the latest code, resulting in wasted CPU resources.


发自我的iPhone

Attachment Content-Type Size
unknown_filename text/html 725 bytes
0114_1.jpg application/octet-stream 6.4 MB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2025-01-14 10:57:34 Re: There is a defect in the ReplicationSlotCreate() function where it iterates through ReplicationSlotCtl->replication_slots[max_replication_slots] to find a slot but does not break out of the loop when a slot is found.
Previous Message Ruben Ruiz 2025-01-13 18:47:12 Re: BUG #18771: ICU custom collations with rules ignore collator strength option.