Re: Error while creating subscription when server is running in single user mode

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error while creating subscription when server is running in single user mode
Date: 2017-06-02 19:24:48
Message-ID: 20170602192448.p44a5u2dsrs6pfi4@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-06-02 19:31:43 Re: Create subscription with `create_slot=false` and incorrect slot name
Previous Message Peter Eisentraut 2017-06-02 19:08:09 Re: Why does logical replication launcher set application_name?