Fix inappropriate comments in function ReplicationSlotAcquire
Wei Wang (Fujitsu) <wangw.fnst@fujitsu.com>
From: "Wei Wang (Fujitsu)" <wangw.fnst@fujitsu.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-01-25T09:26:42Z
Lists: pgsql-hackers
Attachments
- v1-0001-Fix-inappropriate-comments-in-function-Replicatio.patch (application/octet-stream) patch v1-0001
Hi,
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. Attach the patch to remove the inappropriate description of return
value.
Regards,
Wang Wei
Commits
-
Fix comments in ReplicationSlotAcquire().
- a9a47fb6d997 17.0 landed
-
Return ReplicationSlotAcquire API to its original form
- 1632ea43682f 14.0 cited