Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1et54v-0003UP-9T for pgsql-general@arkaria.postgresql.org; Tue, 06 Mar 2018 05:23:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1et54t-0006aH-PP for pgsql-general@arkaria.postgresql.org; Tue, 06 Mar 2018 05:23:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1et54t-0006Y6-4i for pgsql-general@lists.postgresql.org; Tue, 06 Mar 2018 05:23:55 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1et54l-0005Ko-D5 for pgsql-general@lists.postgresql.org; Tue, 06 Mar 2018 05:23:53 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id EF7FF1268; Tue, 6 Mar 2018 00:23:45 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Tue, 06 Mar 2018 00:23:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=miv3oCfYo4pi6cHD8ALe1M2rVFw97ww0sO/ZwyH7UgU=; b=1NsWjNAO RKgzOV3KO7kLae9zgb3X8pWehglVLZsBWXuwpQeTUUbObaCYvrxUNfQf2qwBIzHK a2evAWgOK5ac83uxGKkN455eu6VvToohBnbssJ/NNnZY8j/XmDoi0UwcjP/lzWfI qS9lO3lFEncqDlKuT5/WOoB6WxUmQTJptEcpv/tdhAsgRS4Q/L+Hihhrg2O/2CkV oj0ZQvPxWaa73RlQ/E8Gj43zFfkxhvp3sRYZ/83Gr2tK8SblXncUGcwwqBYbQEOu B6+/kx3lufvBzH3ijHS099NZgy053zUF3ttVaPuJO6CMKVqaaiv1X5lhEkhizY6V l7/oFh7T4eiQXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=miv3oCfYo4pi6cHD8ALe1M2rVFw97 ww0sO/ZwyH7UgU=; b=S2CBJtstOiEUQFnI+mxcpBvNoKZDYnBBjAuG0I4uZKXj6 +scDLB+hcIaqo78YKqBWDa/79oOlMtGwic3sYaL5koxj6z6/UF2aMhEsgxzj8hbw xRjhKxVJ7Wyd5zwedKvOPlNLGQpRVcMIeMJFysXeiulOWfpV+7ToKkDiGG0BBRdf bFl2XCwDJDbjEtnf+faBnrB1T2e6WAgVOrI9GnhjWRtwTGc1zL/7x2sjYWhofWw8 0c2ovGxi0iXFrlHabymE/hUycZEQvqj8mq2sGDvdvYvPrZ6lfxQ9/+4MpiuDmVHV WLhEjblaS5UiieSPdoHax+sPXbw7Not0/ux45VPVw== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id ABEBC7E3CD; Tue, 6 Mar 2018 00:23:43 -0500 (EST) Date: Tue, 6 Mar 2018 14:23:41 +0900 From: Michael Paquier To: Dylan Luong Cc: "pgsql-generallists.postgresql.org" Subject: Re: Resync second slave to new master Message-ID: <20180306052341.GA4717@paquier.xyz> References: <4acf4492b18c4c4ca42bebc8570c84a5@ITUPW-EXMBOX3B.UniNet.unisa.edu.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: <4acf4492b18c4c4ca42bebc8570c84a5@ITUPW-EXMBOX3B.UniNet.unisa.edu.au> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 06, 2018 at 04:45:10AM +0000, Dylan Luong wrote: > After a failover (promote) to the Slave1, is it easily resync the > Slave2 to the new master (old slave1)? Do we need to do full rebuild > of the Slave2 from new master everytime we failover to Slave1 from > Master? Can we use pg_rewind on Slave2 to resyn it with new master > (old slave1)?=20 After promoting slave 1, it could be possible that some records have slipped to slave 2 from the primary. In this case, a rewind would be recommended. You should be careful that your slave 2 has not received WAL to a position newer than where WAL has forked because of the promotion. If that happened, then a rewind would be necessary before replugging slave 2 to the newly-promoted server. Be very careful with your failover flow here. pg_rewind also would not run if it finds that the target server does not need a rewind, so you could stop the slave 2, and run pg_rewind unconditionally to keep things simple. -- Michael --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlqeJd0ACgkQnvQgOdby QH3LLQ/+ImNpYpS1FeIsEv+FiSd9LnROoj2pE4te9jWT8YDputnd2Tb9wwnGyPBG O/XtoxajeM5Fk9UDqqVpsVK4b7hjbusTkoRpRe78ZlaX0PKs7sV9pZ0rQ6VAI5KV +B53QZEXA2LjdBsjrrcUppy/WAe8Jx2UXtApnwRHMi+HGwx+JreBCJ4RKlHmFrO1 wfo629Q+XPXMUSxYjv0rdh7s+I7cCWst46YjUO6u+2wryEycJE4BUSF4Tv+KJWwf 0X8qp+6+5VOokKqPRnw+vlg6QAN1qyOIpkxb7D0QF/WIUOtKT9OhieAEqPSTrK2Y UCdV6dG8Rpjo7iT9m1eDMU0WlQO82V0zX5Q6RUSRv/95y4X2+nHGo271ju75V+Pb M6bdLMu46y9sYV9FTuKh9hIGNZXUUvh9exe795kmTJGQPoocib48v41oNoMgSqpK TFrXekEV25QcGcKLkZtHt8wibKoZwXyesJf+COnabsMOk8OoP4UsjL8D6PQenoYP 9lRRc+48QUu8Uf+W2OLIgXmm6fjN7wzzCrqfWgSC4jCWvk7/vQZmIDpMAdOXJLSD 7qPc3zdw9J094gug1uDcCAjfrZSay3qo48HGwFfvFweb8ACfmlPE8tNWhWGIhwut JCc5pwYvVWmKfaB5i/IjDIOsZjAjyIFtMeENVCrDrAiki4ixyio= =cYy6 -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--