Re: cannot drop replication slot if server is running in single-usermode - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: cannot drop replication slot if server is running in single-usermode
Date
Msg-id 20180508143725.mn3ivlyvgpul6ovr@alvherre.pgsql
Whole thread Raw
In response to Re: cannot drop replication slot if server is running in single-user mode  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: cannot drop replication slot if server is running in single-usermode
List pgsql-hackers
Robert Haas wrote:
> On Thu, Mar 29, 2018 at 5:51 PM, Andres Freund <andres@anarazel.de> wrote:
> >> > 2018-03-06 13:20:24.391 GMT [14869] ERROR:  epoll_ctl() failed: Bad file
> >> > descriptor
> >>
> >> I can confirm this bug exists in single-user mode.
> >
> > I'm not sure we need to do anything about this, personally. This seems
> > like a fairly rare thing to do in a mode that's definitely not intended
> > to be general purpose.
> 
> Mmmph.  I don't really think it's possible to view a user-visible
> EBADF as anything other than a coding error.

IMO the problem is not the user-visible EBADF -- the problem is that the
user might be attempting to clean up from some previous mistake by
removing a replication slot.  Using single-user mode might be a strange
tool, but it's not completely unreasonable.  Is it really all that
difficult to fix slot acquisition for it?

I agree with Tom that for any other operation we can just reject it
early if not under postmaster, but dropping a slot seems a special case.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: cannot drop replication slot if server is running in single-user mode
Next
From: Andrew Gierth
Date:
Subject: Re: MAP syntax for arrays