Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WM1Lp-00019j-09 for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Mar 2014 20:26:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WM1Lm-0000wU-QV for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Mar 2014 20:26:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WM1Ll-0000w3-8u for pgsql-bugs@postgresql.org; Fri, 07 Mar 2014 20:26:33 +0000 Received: from moutng.kundenserver.de ([212.227.126.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WM1Hg-0001Gd-07 for pgsql-bugs@postgresql.org; Fri, 07 Mar 2014 20:22:22 +0000 Received: from anarazel.de (p54AF430D.dip0.t-ipconnect.de [84.175.67.13]) by mrelayeu.kundenserver.de (node=mreue007) with ESMTP (Nemesis) id 0M9AGP-1WTxMS0IOL-00CTQb; Fri, 07 Mar 2014 21:22:17 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 6BD571009EE; Fri, 7 Mar 2014 21:22:16 +0100 (CET) Date: Fri, 7 Mar 2014 21:22:16 +0100 From: Andres Freund To: Sergey Konoplev Cc: pgsql-bugs , Michael Dungan , mcarey@stipple.com Subject: Re: [BUG] Streaming replica sees the old max_connections value Message-ID: <20140307202216.GB28328@awork2.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:S4AFOPO5KEluxoiCH4NZxY5a/kysfrMRQu/KWQdYfB5 rfQtbBeLSRAyjS1WanjHfoFTMFDnV3GkcGDTG5Bb1/pJeAL4Lt r11Q5Vc/t0iIdRntJWtSBKXGUVOi0R32HzreVi+9/fbVsIQKil xh28a6d/NeBkHP8Zwuw/eYVGwoGdFOmwQPrfz6d9O/zz0TyYOB CCB3R2rIxI7Kx7Hu9lBd0drJSTJlVw167ARffSVioWSoCuGxR4 UP5jgmsRrc09UPLEDfkP1MgUqGSrsGphLXhxva/fUAGQWd/sBd mMqwYjtnPWC2/rDKuM7zgrKHP3OExcgZPvVO8KU+GJBV0lxKrx Qc0eP1pYEH7fNpnZ05SeIFB6/2bd3o8ZBRHulYV20 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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