Re: [HACKERS] Error while creating subscription when server isrunning in single user mode - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] Error while creating subscription when server isrunning in single user mode
Date
Msg-id 20170602192448.p44a5u2dsrs6pfi4@alap3.anarazel.de
Whole thread Raw
In response to Re: [HACKERS] Error while creating subscription when server isrunning in single user mode  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] Error while creating subscription when server isrunning in single user mode
Re: [HACKERS] Error while creating subscription when server isrunning in single user mode
List pgsql-hackers
On 2017-06-02 15:00:21 -0400, Peter Eisentraut wrote:
> On 6/1/17 21:55, Andres Freund wrote:
> > On 2017-06-01 21:42:41 -0400, Peter Eisentraut wrote:
> >> We should look at what the underlying problem is before we prohibit
> >> anything at a high level.
> > 
> > I'm not sure there's any underlying issue here, except being in single
> > user mode.
> 
> My point is that we shouldn't be putting checks into DDL commands about
> single-user mode if the actual cause of the issue is in a lower-level
> system.

But it's not really.


> Not all uses of a particular DDL command necessary use a latch,
> for example.  Also, there could be other things that hit a latch that
> are reachable in single-user mode that we haven't found yet.

Latches work in single user mode, it's just that the new code for some
reason uses uninitialized memory as the latch.  As I pointed out above,
the new code really should just use MyLatch instead of
MyProc->procLatch.


> So I think the check should either go somewhere in the latch code, or
> possibly in the libpqwalreceiver code.  Or we make the latch code work
> so that the check-for-postmaster-death code becomes a noop in
> single-user mode.  Suggestions?

I don't think the postmaster death code is really the issue here.  Nor
is libpqwalreceiver really the issue.  We can put ERRORs in a bunch of
unrelated subsystems, sure, but that doesn't really solve the issue that
logical rep pretty essentially requires multiple processes.  We've
prevented parallelism from being used in general (cf. standard_planner),
we've not put checks in all the subsystems it uses.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Why does logical replication launcher setapplication_name?
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Create subscription with `create_slot=false` andincorrect slot name