Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipPU7-0007PP-Ji for pgsql-general@arkaria.postgresql.org; Thu, 09 Jan 2020 04:31:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ipPU5-0005SE-A0 for pgsql-general@arkaria.postgresql.org; Thu, 09 Jan 2020 04:31:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipPU5-0005S7-01 for pgsql-general@lists.postgresql.org; Thu, 09 Jan 2020 04:31:49 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ipPU2-0004XC-M1 for pgsql-general@postgresql.org; Thu, 09 Jan 2020 04:31:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 1A2849A6; Wed, 8 Jan 2020 23:31:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 08 Jan 2020 23:31:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=odQKbDsbdtOipUkAlZRXCYrsTG+ j32Dl+L6f52Cdkb8=; b=S2qah+QBXv6ZOjIqd274JgT1mIncmwj9UFW2k6rUg1z NkfUqj292Juow9EKdUsNMNtfXePV8iEn5WyHTl183YTkebTCQgL/4fS+eDyjdSj4 eFrjL0LxgLcptIvyhyMK0aeaqH7rYKLK8ynshjzDav12aCtngdBXP5aoeXWGYLVr 8odiPHE61bhSAgBLyoijBZ6q6HxpObBBPHM3viQv3AwaEXMGmAfZjnSsuffuDcqg 34NyrzuFndCE6H/hfaLeHJ4dtM9HAStEiIXEoyembOp4j7yvHUMWKT2BuAPDvuXy i7b8wPi/3qhj/rkLRMJ1jx2GWzGqLWD4FiOnfrxkkZA== 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-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=odQKbD sbdtOipUkAlZRXCYrsTG+j32Dl+L6f52Cdkb8=; b=ML+CaoPENCEvsV9YMrtxrU GdCbeeeOc56tpzFu17ff1FGID1FAv9RWVQLd42pTRxNNFhQZOURtjv5cx4Lz/TmH 9QzX9FtJeNTGp9EIsImcdvo4w8xjEdNPu63j4YAFuVYe21zHUZbRQHUJ2c4cYYZJ DLDg5ALLwkW9yrKk2/4/QOoHifH0SbocZDRLUKWHl6mWC1XJfUS2PeSU96PLjNNH ZAeqJLMbJM5MkR91aQYqwtgpJQYJtnqXbhOWca4l3YTHc6GahMVev8/PG8A1drs4 0xXjMoRntdRkml8wA2pNRRJNsiwINcS6dxxtatjg0y6GkroOwglTUjRN+Zv2N7Sg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdehledgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucfkphepuddukedrvd eguddrvdehtddrvdeftdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (mp76f1fae6.ap.nuro.jp [118.241.250.230]) by mail.messagingengine.com (Postfix) with ESMTPA id E2E4C80059; Wed, 8 Jan 2020 23:31:41 -0500 (EST) Date: Thu, 9 Jan 2020 13:31:39 +0900 From: Michael Paquier To: Rita Cc: pgsql-general@postgresql.org Subject: Re: what to do after a failover Message-ID: <20200109043139.GI2251@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IA03tywDYuoVKXrw" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --IA03tywDYuoVKXrw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 08, 2020 at 11:06:28PM -0500, Rita wrote: > I run a master and standby setup with Postgresql 11. The systems are > identical from a hardware and software setup. If the master goes down I > can do a pg_ctl promote on the standby and point my applications to use the > standby (new master). > > Once the original master is online, when is an appropriate time to fail > back over? And are there any other things besides promote after the > failover is done? Make sure that you still have an HA configuration able to handle multiple degrees of failures with always standbys available after a promotion. The options available to rebuild your HA configuration after a failover depend on the version of PostgreSQL you are using. After a failover the most simple solution would be to always recreate a new standby from a base backup taken from the freshly-promoted primary, though it can be costly depending on your instance. You could also use pg_rewind (available in core since 9.5) to recycle the previous primary and reuse it as a standby of the new promoted custer. Note that there are community-based solutions for such things, like pg_auto_failover or pacemaker-based stuff just to name two. These rely on more complex architectures, where a third node is present to monitor the others (any sane HA infra ought to do at least that to be honest). -- Michael --IA03tywDYuoVKXrw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4WrKsACgkQnvQgOdby QH3iXw//YjamTvDIGL8qMFQvqHGcqbWcyigVRkZBhVnqS8vwxRt07dGb5bE64vhm WbVe5YwHlYR1MLxe9EKEZQ5akUY78pec5W8Tk6IHh9SuGxvrzUXARuTx3mkeSJKt XvvP8urof0GIFJARYs5WJ+QttuktmGHaDZftIcIhQ4E31d6/UO0pW1lJwK4r89Yk oCxeklFXvFRZjSJvSmG63+38osXyQOgbggSvfT/cgAhOe2ghTvsuwTE5RGcz35P/ l7k3Fi0BWYZJkwwQgFpvSBGRn0rP/ro7YpLYEN+nYFzzFxhGY3z51jlNkFzzYKX6 RCEHWz2iCxQvPqslLhNgr0w7ESKNYGJLzKT24GfSo4rqZkWN7ZXSmw7Aw9dJlFE1 OccCw4MFuK15fckGEVpYCyMXt59QWezyn/+FJShKuugdKV76X8h2OluZepDgd08g L+2PtfwLcpDWw8BB+pH50UWfqp+li7BaEEanHK32rG6D9wRmjOHcVoY4qtmDmNEL dV8h8IW7IeEcaXxvRY8YE/18EJotfu90mAENZyYFPOhZTFPianajgOFz7zYLH6ED wOeHLCqwY+yKW/OTXS06d6LsTqbmQAS93dScRhISixqa/zfVKEEstAL8knbcBH1+ 4cLMI1l8btsU9sCOXcYa9cEkcdLdvJ64KLxNdfU961qUzyTN7XY= =cimp -----END PGP SIGNATURE----- --IA03tywDYuoVKXrw--