Re: [15] Custom WAL resource managers, single user mode, and recovery

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [15] Custom WAL resource managers, single user mode, and recovery
Date: 2022-07-15 03:58:27
Message-ID: 20220715035827.d2uoaxpklnri6a43@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2022-07-14 23:42:56 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2022-07-14 20:48:57 -0400, Tom Lane wrote:
> >> (I wonder if we shouldn't refactor this so that the postmaster
> >> and standalone mode share more of the initialization logic.
> >> Keeping these bits in sync seems unlikely to happen otherwise.)
>
> > Yes, that might be worthwhile. OTOH, I wonder if we should spend that time to
> > remove single user mode instead - the architectural complexity really doesn't
> > seem worth it anymore, and IMO my prototype from a few months back showed that
> > it's feasible.
>
> I dunno ... if your DB is in bad enough shape that you need to resort
> to single-user mode, you probably don't want any more moving parts
> in the system than you absolutely have to have.

Well, right now the main reason people need single user is anti-wraparound
stuff. And there it's actively harmful (requiring a shutdown checkpoint,
emptying shared buffers, foreground checkpoints, foreground writing of all
WAL, etc).

It's also not comforting to hit a lot of codepaths that are exercised rarely,
when things already have gone pear-shaped. We've had plenty bugs - in
important paths like releasing lwlocks in case of errors - that were single
user specific.

> Autovacuum, custom background workers, and the like are going to be
> counterproductive.

I think it'd be better to address those with a GUC more squarely aimed at
disabling systems you don't need when on a corrupted cluster.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Johansen 2022-07-15 04:22:43 Re: Auto-vacuum timing out and preventing connections
Previous Message Tom Lane 2022-07-15 03:42:56 Re: [15] Custom WAL resource managers, single user mode, and recovery