From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Bernd Helmle <mailings@oopsware.de>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: standalone backend PANICs during recovery
Date: Tue, 30 Aug 2016 10:00:39 -0400
Message-ID: <28712.1472565639@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqTMej=udzm+TwUbMzfaPBfGTOY3AVpyPUP3VxdTOgHD1A@mail.gmail.com>
References: <20160402215748.GA136801@alvherre.pgsql>
<12838.1471639801@sss.pgh.pa.us>
<2086.1471711308@sss.pgh.pa.us>
<2DA7350F7296B2A142272901@eje.land.credativ.lan>
<CAB7nPqTWSW83pDu1VOgzG4ikM+_Da9AwFCgEWHWmgv87tp2FoA@mail.gmail.com>
<23650.1472561302@sss.pgh.pa.us>
<CAB7nPqSTN3Q_qz1Xu3=nEW5v_=AN=cXoPFBLTvW8SBEsBR42DQ@mail.gmail.com>
<25082.1472563473@sss.pgh.pa.us>
<CAB7nPqTMej=udzm+TwUbMzfaPBfGTOY3AVpyPUP3VxdTOgHD1A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Michael Paquier <michael.paquier@gmail.com> writes:
> Does the attached suit better then?
Thinking about it some more ... what we actually need to prevent, AFAICS,
is standby_mode becoming true in a standalone backend. If you don't set
that, then the process will do PITR recovery, but I'm not aware that there
is any problem with running that standalone, and maybe it's useful to
allow it for debugging purposes. So I'm thinking more like
/*
* Check for recovery control file, and if so set up state for offline
* recovery
*/
readRecoveryCommandFile();
+ /*
+ * We don't support standby_mode in standalone backends; that
+ * requires other processes such as WAL receivers to be alive.
+ */
+ if (StandbyModeRequested && !IsUnderPostmaster)
+ ereport(FATAL, ...);
+
/*
* Save archive_cleanup_command in shared memory so that other processes
* can see it.
*/
or we could put the check near the bottom of readRecoveryCommandFile.
Not sure which placement is clearer.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com, mailings@oopsware.de, alvherre@2ndquadrant.com, simon@2ndquadrant.com
Subject: Re: standalone backend PANICs during recovery
In-Reply-To: <28712.1472565639@sss.pgh.pa.us>
References: <20160402215748.GA136801@alvherre.pgsql> <12838.1471639801@sss.pgh.pa.us> <2086.1471711308@sss.pgh.pa.us> <2DA7350F7296B2A142272901@eje.land.credativ.lan> <CAB7nPqTWSW83pDu1VOgzG4ikM+_Da9AwFCgEWHWmgv87tp2FoA@mail.gmail.com> <23650.1472561302@sss.pgh.pa.us> <CAB7nPqSTN3Q_qz1Xu3=nEW5v_=AN=cXoPFBLTvW8SBEsBR42DQ@mail.gmail.com> <25082.1472563473@sss.pgh.pa.us> <CAB7nPqTMej=udzm+TwUbMzfaPBfGTOY3AVpyPUP3VxdTOgHD1A@mail.gmail.com> <28712.1472565639@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox