Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAObC-0007Mj-9u for pgsql-docs@arkaria.postgresql.org; Tue, 25 Aug 2020 02:22:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAObB-00065r-7p for pgsql-docs@arkaria.postgresql.org; Tue, 25 Aug 2020 02:22:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAObB-00065k-29 for pgsql-docs@lists.postgresql.org; Tue, 25 Aug 2020 02:22:09 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAOb8-0008Cb-QW for pgsql-docs@lists.postgresql.org; Tue, 25 Aug 2020 02:22:08 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 151C85C009A; Mon, 24 Aug 2020 22:22:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 24 Aug 2020 22:22:05 -0400 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=fm2; bh=e1HJ/4HfooSAP+DVdhpIkelx7JL JhTlFKjAJjeoD9lY=; b=EhzpAczEptiTQCbXOnn4ik7NnK0kmcMbF6fjyDDIdF2 ojXpEJ9x11AzhZKI33MYqL0OCj9X557hmDdwqKmojHgf7S0M8ez5Y3u3gYc4jkn3 fMEICq8Tsg/FUIOdMIfXslaQfPaBV1Crut+7Gm2/wuxEYnf9ih3J576huu8oQJvM 8DZLWpWgwre5HuQ3AyujGfOH3LKhxDgxFb1+2DIdfcKuGUc/OjBtFV6TAZsD+s6D z2Tp/T3m0Vii9RNigGYx2OUQkJj0jFqjmbvAzBrCWJa7TX6YXijscN4j0EPEmhRf pC+OlFF/zRpAIOmcSjP9+p921Ta16JD3FKZr/zDLbJA== 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=fm3; bh=e1HJ/4 HfooSAP+DVdhpIkelx7JLJhTlFKjAJjeoD9lY=; b=bKE/rtpM6CFaLWmPwIy+S7 QoMIaYCMZwEfhMhIFywkSk+OPTKnwiXX03J4Yfa8p7mRdh54Sv/VP1StiXDaxVji jqdUI4wsZXdAKJdFOVjQ+rKeww64i1M304eOVqFgPg3xVcHFFbL1pJBPLuvtmBnu rKYu1sgVuE8YpqNTGLM2H7x7IDSTItPRYC+Xas2vPN3zI63R9iQupI79jc7AmSK7 r6Wnk03JB+/20zt4cRKZUqZkqroyPlv399u2hqmojoea4DUhiONFljzQ1Wscbv6P XnwyttAvCPzuHR1hFxcYc7pTXYuSSqty5nyMELi6KHn6OSuw8Hx74CZjndMdyUuw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudduledgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpedvgeduuefhtdeuleettdevjeehheeiveeuieegleetgeeljeelieeuieehgeevhfen ucfkphepudduuddruddtvddrudektddrudekheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id AFB533280064; Mon, 24 Aug 2020 22:22:03 -0400 (EDT) Date: Tue, 25 Aug 2020 11:22:00 +0900 From: Michael Paquier To: rams nalabolu Cc: pgsql-docs@lists.postgresql.org Subject: Re: PostgreSQL switchover process Message-ID: <20200825022200.GB2017@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Yylu36WmvOXNoKYn" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Aug 24, 2020 at 03:56:43PM -0400, rams nalabolu wrote: > I did the following steps to perform switchover > 1) ran a checkpoint on primary. > 2) verified secondary status and it is up to date with primary. > 3) stopped primary using pg_ctl -mf i.e force. This is not a force mode, but the fast mode, where all existing connections are forcibly stopped, and that the shutdown is clean, with a shutdown checkpoint generated before finishing the shutdown sequence. During this shutdown, the primary makes sure that all standbys have flushed WAL up to the point of the shutdown checkpoint. Note that this makes rather unnecessary the checkpoint you ran on the primary in step 1. > 4) promoted primary using trigger file and verified the status of the new > primary; it is not in recovery mode and running on new timeline ID 2. I think that you mean promotion of the standby here. > 5) I did create the recovery.conf file on old primary i.e new standby with > primaray_coninfo: new primary(B) > recovery_target_timeline='latest' > primary_slot_name: "slot I created in new_standby" Typo here. You mean primary_conninfo. > 6) I started the new standby. It is up and running but it is not in > recovery mode. This switchover flow is a good base, so it should be possible to reuse your previous primary as a standby. > But the wal sender process on primary and receiver process on secondary are > not running. i.e it looks like my replication is broken. > what steps am I missing here without rebuilding a new standby i.e old > primary I want the replication happen b/w my new primary and > secondary. It may be many things without more information. Could you check pg_stat_replication on the primary and pg_stat_wal_receiver on the standby? Most likely something is wrong with primary_conninfo, but the logs of the standby should have enough information to let you know what happened. Another thing you are not telling is the version of PostgreSQL you are using here. In 12 and newer versions, support for recovery.conf has been removed, requiring roughly the creation of standby.signal with all recovery parameters set in postgresql.conf if you want to set up a standby. -- Michael --Yylu36WmvOXNoKYn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl9EdcgACgkQnvQgOdby QH0uZw/9Egr4Q5fT/TjW2P4Rsw4lJZVNYMvj1IVbBkRZtXzpm5RgzM/fA4pvClhi xTzJvWJpqAH1s1BIh9RQAY9VqrawW7U0hyGjh/UvNDESE6sIbSj6jqBlEt1uviQD afv6U7AkGgxu0v0WHPuHf5YGQLVjPZ5FheXpN/ZC96tq+/awBxipAbFpgrSEIN4s ZNYOeCrpkWUbDPhaKjBw4nWy7n5AICSsZcylYmOfjbijlXykzKcHTP70COv5esE1 3PxKHUJRrBMjyF4+jMba8iAHHbUv3zDmhZA5fMO+7m1QNw+y9Xf5KRtsbzmwOfif 57RsqEx/sG2GO752yeGeFxBHeVBdXOcOXYUoHo5CnBM2R8AC9JaSTvvSoTwdhO3k 0yWsflqpf6Jb00JYT+5Ftg0zhHjmcvybknGOAJiMQsYBqZfOFM98qh4hFfrZwGzL 8aBNQxXCjIHt/sLJdvV9Wn4JChGmwhw7XSCr1XV0kJRefcmYqvvr3RfAwIyf2362 z/hcqD065xovmmcM7jcHibx4dVSSw3wLxgfS2gQLraAKilAb7BnVl6GllT4EbJkH Uw7onL/7hQMtkqq0uQNWWoKYlnjXnoPaaW9dLbXOEyNmFbAZeJrJu8sV3Nl5fu83 7v8dtMr18bUMYOL0WWNdULllCW8tE7O2oJp7l055tV1ll4cToOc= =tbEu -----END PGP SIGNATURE----- --Yylu36WmvOXNoKYn--