Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C8ABD6B86D1 for ; Mon, 5 Dec 2011 22:41:48 -0400 (AST) Received: from qmta15.westchester.pa.mail.comcast.net ([76.96.59.228]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RXkyY-0007xT-N3 for pgsql-admin@postgresql.org; Tue, 06 Dec 2011 02:41:47 +0000 Received: from omta08.westchester.pa.mail.comcast.net ([76.96.62.12]) by qmta15.westchester.pa.mail.comcast.net with comcast id 5ecq1i0030Fqzac5Feha4M; Tue, 06 Dec 2011 02:41:34 +0000 Received: from homie ([68.45.149.190]) by omta08.westchester.pa.mail.comcast.net with comcast id 5ehZ1i01146izrY3UehZxP; Tue, 06 Dec 2011 02:41:34 +0000 Received: by homie (Postfix, from userid 1000) id E4335182864; Mon, 5 Dec 2011 21:41:31 -0500 (EST) To: Martin S Cc: pgsql-admin@postgresql.org Subject: Re: Recover from failover References: From: Jerry Sievers Date: Mon, 05 Dec 2011 21:41:31 -0500 In-Reply-To: (Martin S.'s message of "Mon\, 5 Dec 2011 17\:22\:04 -0300") Message-ID: <87bormwhes.fsf@comcast.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201112/36 X-Sequence-Number: 38794 Martin S writes: > Hello list, > > May be this information is inside the documentation, but couldn't find it. > > I'm doing some tests with postgres 9.1.1 and replication, and I was > wandering if there is some information about how to recover from a > failover. > > Suppose I'm doing some kernel upgrades on the master, so in order to > avoid downtime, I promote the slave to become the master, and reboot > the old-master. Once the old-master is up and running again, I want it > to be the master as it was before. The problem are the updates and > inserts made while it was offline. Does it recovers automagically by > streaming or something? Do you have any procedures/recommendations to > do it? About the only way you can role reverse master and standby is to stop immediate the master, online the standby and then config the old master as a standby and point it to the new master. Doing a normal stop on the original master before onlining the standby, then making changes to the old master DB and you'll have to refresh the old master from a base backup before putting it into recovery. Most admins will tell you to refresh the old master in either case to be on the safe side. This is the conventional and guaranteed to work approach. HTH > Cheers, > > Martin > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 305.321.1144