Re: Fix inappropriate comments in function ReplicationSlotAcquire

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Fix inappropriate comments in function ReplicationSlotAcquire
Дата
Msg-id CAA4eK1+FR72RW5Y6CKNv7ojScC-Ew0YxjfV5TwiCUoA1W1maHw@mail.gmail.com
обсуждение исходный текст
Ответ на Fix inappropriate comments in function ReplicationSlotAcquire  ("Wei Wang (Fujitsu)" <wangw.fnst@fujitsu.com>)
Ответы RE: Fix inappropriate comments in function ReplicationSlotAcquire  ("Wei Wang (Fujitsu)" <wangw.fnst@fujitsu.com>)
Список pgsql-hackers
On Thu, Jan 25, 2024 at 2:57 PM Wei Wang (Fujitsu)
<wangw.fnst@fujitsu.com> wrote:
>
> In the function ReplicationSlotAcquire(), I found there is a missing in the
> below comments:
>
> ```
>         /*
>          * Search for the slot with the specified name if the slot to acquire is
>          * not given. If the slot is not found, we either return -1 or error out.
>          */
>         s = SearchNamedReplicationSlot(name, false);
>         if (s == NULL || !s->in_use)
>         {
>                 LWLockRelease(ReplicationSlotControlLock);
>
>                 ereport(ERROR,
>                                 (errcode(ERRCODE_UNDEFINED_OBJECT),
>                                  errmsg("replication slot \"%s\" does not exist",
>                                                 name)));
>         }
> ```
>
> It seems that when the slot is not found, we will only error out and will not
> return -1.
>

You seem to be correct. However, isn't the first part of the comment
also slightly confusing? In particular, "... if the slot to acquire is
not given." In this function, I don't see the case where a slot to
acquire is given.

--
With Regards,
Amit Kapila.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: speed up a logical replica setup
Следующее
От: vignesh C
Дата:
Сообщение: Re: Documentation to upgrade logical replication cluster