Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yb9WY-00037y-Dm for pgsql-admin@arkaria.postgresql.org; Thu, 26 Mar 2015 15:16:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yb9WX-0005Kc-SX for pgsql-admin@arkaria.postgresql.org; Thu, 26 Mar 2015 15:16:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yb9WW-0005IS-DT for pgsql-admin@postgresql.org; Thu, 26 Mar 2015 15:16:44 +0000 Received: from imx3.etecsa.cu ([200.55.152.137]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yb9WQ-0003HN-Kb for pgsql-admin@postgresql.org; Thu, 26 Mar 2015 15:16:43 +0000 Received: from Unknown ([192.168.91.45] helo=mn3.etecsa.cu) by imx3.etecsa.cu with ESMTP id tAFUpK3w72890; Thu, 26 Mar 2015 10:15:30 -0500 Received: (qmail 17041 invoked by uid 11185); 26 Mar 2015 16:16:15 -0000 Received: from 192.168.91.6 by mn3.etecsa.cu (envelope-from , uid 502) with qmail-scanner-2.08 (spamassassin: 3.2.5. Clear:RC:1(192.168.91.6):. Processed in 0.024331 secs); 26 Mar 2015 16:16:15 -0000 Received: from unknown (HELO webmail.etecsa.cu) ([192.168.91.6]) (envelope-sender ) by mn2.etecsa.cu (qmail-ldap-1.03) with SMTP for ; 26 Mar 2015 16:16:15 -0000 Received: from 192.168.207.54 (SquirrelMail authenticated user gilberto.castillo) by webmail.etecsa.cu with HTTP; Thu, 26 Mar 2015 11:16:14 -0500 (GMT+5) Message-ID: <45346.192.168.207.54.1427386574.squirrel@webmail.etecsa.cu> In-Reply-To: <848F3721-4A21-4260-9640-8F698E3EE376@skogoglandskap.no> References: <848F3721-4A21-4260-9640-8F698E3EE376@skogoglandskap.no> Date: Thu, 26 Mar 2015 11:16:14 -0500 (GMT+5) Subject: Re: postgres hot-standby questions. From: "Gilberto Castillo" To: "Graeme B. Bell" Cc: "pgsql-admin@postgresql.org" , "Simon Riggs" Reply-To: gilberto.castillo@etecsa.cu User-Agent: SquirrelMail/1.4.8-5.el5_4.10 MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal X-SpamTest-Envelope-From: gilberto.castillo@etecsa.cu X-SpamTest-Info: Profiles 72422 [Jan 28 2015] X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0285], KAS30/SDK/Release X-Anti-Virus: Kaspersky Mail Gateway, version: 5.6.28/RELEASE, bases: 20140401T050822 #7726142, check: 20150326 clean Content-Type: multipart/mixed; boundary="=tAFVpmAk72106=imx3.etecsa.cu=" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multi-part message in MIME format. --=tAFVpmAk72106=imx3.etecsa.cu= Content-Disposition: inline Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit > > Hello everyone, > > Two questions, grateful for any feedback anyone can share. They relate to > switchover between master and hot-standby. > > > 1. What exactly is the behaviour of the master/primary during shutdown > when it has a hot standby? > > https://wiki.postgresql.org/wiki/Hot_Standby > http://www.postgresql.org/docs/current/static/hot-standby.html > > If I shut down the master, then afterwards when it is finished, I shut > down the standby, will they contain identical logical databases & WAL > records, e.g. assuming possible network failure? > > i.e. > - Is the primary shutdown delayed until it has received notice from the > standby that all WAL has been received? ( my guess is: no) > - Is the primary shutdown delayed until it has received notice from the > standby that all WAL has been applied? ( my guess is: no) > - Can the primary generate any new WAL (e.g. checkpoint) or logical data > changes during the shutdown process that might not be sent to the standby? > (my guess is: no) > > For example, > https://vibhorkumar.wordpress.com/2014/06/30/switchoverswitchback-in-postgresql-9-3/ > "With this patch, the walsender process tries to send all outstanding WAL > records to the standby in replication when the user shuts down the > master." > "tries"? > > That page also makes it seem like you have to manually check the WAL > status. (section 2) > Is there any way to make the primary's completion of shutdown > automatically synchronous with completion of WAL on standby(s)? What you used for you repltación? aplication u other. > > 2. Let's assume for the moment I have some crazy reason to prefer to avoid > rsync where possible, such as its historical weird behaviour on HFS+ > filesystems or its present unreliable heuristic for syncing hard-links or > its default behaviour of not using checksums. Can a controlled switchover > (not failover) be built on wal_keep_segments alone? > > wal_keep_segments could be set to a fairly high number, maybe 10000 > (160GB) to allow standby catchup even after a day. Let's assume here than > 99% of maintenance takes less than an hour, and that we're keeping rsync > as a fallback for the worst case. > > e.g. here's the whole switchover process... > > shutdown A (Master) > shutdown B (Standby) > (A and B should be identical in terms of WAL and logical data at this > point). > swap M/S configurations around > start B (Master) > > do some work on A for an hour > finish work on A > > start A (Standby) > A catches up with B from wal_keep_segments. > > > shutdown B (Master) > shutdown A (Standby) > (A and B should be identical in terms of WAL and logical data at this > point). > swap M/S configurations around > start A (Master) > start B (Standby) > Remeber init the slave igual firt moment. > Graeme Bell > > > > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin--- > This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE > running at host imx2.etecsa.cu > Visit our web-site: , > Saludos, Gilberto Castillo La Habana, Cuba --=tAFVpmAk72106=imx3.etecsa.cu= Content-Type: text/plain Content-Disposition: inline --- This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu Visit our web-site: , --=tAFVpmAk72106=imx3.etecsa.cu= Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin --=tAFVpmAk72106=imx3.etecsa.cu=--