RE: Fix inappropriate comments in function ReplicationSlotAcquire

From: "Wei Wang (Fujitsu)" <wangw(dot)fnst(at)fujitsu(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Fix inappropriate comments in function ReplicationSlotAcquire
Date: 2024-01-26 01:17:06
Message-ID: OS3PR01MB62755CE4BD9AE43782DE84AC9E792@OS3PR01MB6275.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 25, 2024 at 20:33 Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Thu, Jan 25, 2024 at 4:01 PM Wei Wang (Fujitsu)
> <wangw(dot)fnst(at)fujitsu(dot)com> wrote:
> >
> >
> > Yes, agree. I think these two parts have become slightly outdated after the
> > commit 1632ea4. So also tried to fix the first part of the comment.
> > Attach the new patch.
> >
>
> How about changing it to something simple like:
> diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
> index f2781d0455..84c257a7aa 100644
> --- a/src/backend/replication/slot.c
> +++ b/src/backend/replication/slot.c
> @@ -465,10 +465,7 @@ retry:
>
> LWLockAcquire(ReplicationSlotControlLock, LW_SHARED);
>
> - /*
> - * 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.
> - */
> + /* Check if the slot exits with the given name. */
> s = SearchNamedReplicationSlot(name, false);
> if (s == NULL || !s->in_use)
> {

It looks good to me. So, I updated the patch as suggested.

Regards,
Wang Wei

Attachment Content-Type Size
v3-0001-Fix-inappropriate-comments-in-function-Replicatio.patch application/octet-stream 1002 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-01-26 01:32:48 Re: [PATCH] Add native windows on arm64 support
Previous Message Michael Paquier 2024-01-26 00:52:17 Re: Use of backup_label not noted in log