Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZNoD-0004bj-1e for pgsql-admin@arkaria.postgresql.org; Wed, 10 Jan 2018 21:21:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZNoC-0002Ra-Kp for pgsql-admin@arkaria.postgresql.org; Wed, 10 Jan 2018 21:21:16 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eZNoC-0002RR-E3 for pgsql-admin@lists.postgresql.org; Wed, 10 Jan 2018 21:21:16 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eZNo9-0002fo-Is for pgsql-admin@lists.postgresql.org; Wed, 10 Jan 2018 21:21:15 +0000 Received: from Davids-iMac.local (unknown [173.169.74.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 1DF695469A; Wed, 10 Jan 2018 21:21:11 +0000 (UTC) Subject: Re: Broken replication in 3 node setup, master halt, standby 1 promoted, standby 2 - replication not working To: Pritam Barhate , pgsql-admin@lists.postgresql.org References: From: David Steele Message-ID: <851d5773-9911-c2f7-51ba-3dfe0a5108a5@pgmasters.net> Date: Wed, 10 Jan 2018 16:21:10 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Pritam, On 1/10/18 2:06 PM, Pritam Barhate wrote: <...> > > It reports both the standbys working correctly.  > > Halt pg1.  > > On pg2: > > sudo -u postgres pg_ctlcluster 9.6 main promote > > On pg3: > > sudo service postgresql stop > > sudo -u postgres vim /var/lib/postgresql/9.6/main/recovery.conf > > modify it's contents are as follows: > > ``` > primary_conninfo = 'host=pg2 port=5432 user=replicator' > standby_mode = 'on' > restore_command = '/usr/bin/pgbackrest --stanza=main archive-get %f "%p"' > ``` This all looks fine. I'm not sure why (without testing the configuration), but the switch to timeline 2 switch is not happening. Try setting: recovery_target_timeline=latest in recovery.conf on pg3. It's possible that pg3 played past the time when timeline 2 diverged on pg2 (i.e. pg3 was more up to date), in which case you will need to restore pg3 from a backup and set the recovery_target_timeline as above. -- -David david@pgmasters.net