pgsql: Prevent starting a standalone backend with standby_mode on.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Prevent starting a standalone backend with standby_mode on.
Date: 2016-08-31 12:52:36
Message-ID: E1bf50O-0003j3-RM@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Prevent starting a standalone backend with standby_mode on.

This can't really work because standby_mode expects there to be more
WAL arriving, which there will not ever be because there's no WAL
receiver process to fetch it. Moreover, if standby_mode is on then
hot standby might also be turned on, causing even more strangeness
because that expects read-only sessions to be executing in parallel.
Bernd Helmle reported a case where btree_xlog_delete_get_latestRemovedXid
got confused, but rather than band-aiding individual problems it seems
best to prevent getting anywhere near this state in the first place.
Back-patch to all supported branches.

In passing, also fix some omissions of errcodes in other ereport's in
readRecoveryCommandFile().

Michael Paquier (errcode hacking by me)

Discussion: <00F0B2CEF6D0CEF8A90119D4(at)eje(dot)credativ(dot)lan>

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/823df401d1840a6f5e94d5f725ccf03317cc1176

Modified Files
--------------
src/backend/access/transam/xlog.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-08-31 13:03:38 pgsql: Use static inline functions for float <-> Datum conversions.
Previous Message Robert Haas 2016-08-31 07:12:44 pgsql: Update comments to reflect code rearrangement.