Re: Review for GetWALAvailability() - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Review for GetWALAvailability()
Date
Msg-id 20200618.163259.1346781325217853057.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: Review for GetWALAvailability()  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Review for GetWALAvailability()  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
At Thu, 18 Jun 2020 14:54:47 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> wrote in 
> Sorry, this caused compiler failure. So I fixed that and
> attached the updated version of the patch.

At Thu, 18 Jun 2020 14:40:55 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> wrote in 
> > + errmsg("replication slot \"%s\" does not exist", name)));
> > The error message is not right when the given slot doesn't match the
> > given name.
> 
> This doesn't happen after applying Alvaro's patch.

If name is specified (so slot is NULL) to
ReplicationSlotAcquireInternal and the slot is not found, the ereport
in following code dereferences NULL.

====
    if (s == NULL || !s->in_use)
    {
        LWLockRelease(ReplicationSlotControlLock);

        if (behavior == SAB_Inquire)
            return -1;
        ereport(ERROR,
                (errcode(ERRCODE_UNDEFINED_OBJECT),
                 errmsg("replication slot \"%s\" does not exist",
                        name ? name : NameStr(slot->data.name))));
    }
====

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Add Information during standby recovery conflicts
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Review for GetWALAvailability()