From: Andres Freund <andres@2ndquadrant.com>
To: Sergey Konoplev <gray.ru@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: Michael Dungan <mpd@stipple.com>
Cc: mcarey@stipple.com
Subject: Re: [BUG] Streaming replica sees the old max_connections value
Date: Fri, 7 Mar 2014 21:22:16 +0100
Message-ID: <20140307202216.GB28328@awork2.anarazel.de> (raw)
In-Reply-To: <CAL_0b1tUjbcjK0K9CU3KttimHiwBWcaHm-L8vTTo=AiWLLXPPg@mail.gmail.com>
References: <CAL_0b1tUjbcjK0K9CU3KttimHiwBWcaHm-L8vTTo=AiWLLXPPg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2014-03-07 12:09:54 -0800, Sergey Konoplev wrote:
> Today, when I tried to change a value of max_connections I faced a
> strange postgres behavior on the replicas. The old value was 500. I
> changed it in the config files of all the servers to 100. Then I
> restarted postgres the master and everything was fine. However, when I
> restarted it the replicas I got a fatal on both of them:
>
> [...]
> LOG: database system is shut down
> LOG: database system was shut down in recovery at 2014-03-07 19:00:49 GMT
> LOG: entering standby mode
> FATAL: hot standby is not possible because max_connections = 100 is a
> lower setting than on the master server (its value was 500)
> LOG: startup process (PID 12187) exited with exit code 1
That's easy to explain. The check is done based on the control file and
that's already on the standby in your case. You need to first replay a
bit of WAL from the primary after lowering the value, triggering the
standby to update what it knows about the master's settings. When
lowering values, it's simplest to first restart the primary with the new
values, wait for the standbys to catch up, and then restart them.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: andres@2ndquadrant.com, gray.ru@gmail.com, mpd@stipple.com, mcarey@stipple.com
Subject: Re: [BUG] Streaming replica sees the old max_connections value
In-Reply-To: <20140307202216.GB28328@awork2.anarazel.de>
References: <CAL_0b1tUjbcjK0K9CU3KttimHiwBWcaHm-L8vTTo=AiWLLXPPg@mail.gmail.com> <20140307202216.GB28328@awork2.anarazel.de>
* 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