Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVAcO-0002xf-89 for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 06:59:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVAcL-0003YT-5i for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 06:59:53 +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.89) (envelope-from ) id 1fVAcJ-0003YI-Bo for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 06:59:53 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVAcE-0002CZ-PL for pgsql-bugs@postgresql.org; Tue, 19 Jun 2018 06:59:50 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A36C6221FB; Tue, 19 Jun 2018 02:59:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 19 Jun 2018 02:59:44 -0400 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= fm2; bh=xK9GNDeWk6UxRCqEMVvsZ4qyjEaqjT++QqGa0JsDQqo=; b=bDbtyNQt dcbuW7aeRhEy8/ocZKLyEu/h3GX+NVVU5FCESiA6fcisA8RUbjZo/nFEZb7s40jc xAfXXv6WTNBpDcFvNpmkbsMcrOeQ8vKWSQGYhODBYG3CU1rVhBgsaMHkLMuhWD3y V+X0kmLky+nsHz9hnfmfBN2L/oGRe5BLDQsUYrJ4/tJB8tJvQc2Z8Gj4YSrZLC4D oqu3/JgLLe8OPhLypekg+pkuPR2motq75rpx4zCFoHkGuQ3D+ysl5p/mbc6hiX0E nuTaCvNJyEpIzM0JtxvCVFCq3WB04/fIf+NsozhhJerEakCzcchG2a/kNSeg/MHB 5L0dcEpMX9iZ5g== 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=fm3; bh=xK9GNDeWk6UxRCqEMVvsZ4qyjEaqj T++QqGa0JsDQqo=; b=ElJEjU6MMABLCLj6F5RtgwZOcOAEsEcnRM1ZsJ2f7rBru mwPemq4V/kqvK90Gdyj33SXtGElXEPwI3w1ztfX4/Ux5WzSm5HWmXLDRcCDjcNoB aNrVVO18uklKvvJPVjOoCPgH2ZnZihCjI1fnpSslTRK8WeSZUv/RpaRMwiQMTvMf 1hTm6bY3VqQCl1G/uvu4FD4Vv0uCooJbeMLLHuxWoVzNQ4IZZyGUinAGuQeaCKT1 PUsnn273WMpDTN+bXPpJjy9hFIS9iktaBGOlR4f66taAUqgmDKFq8lvFcSVby10o dHdfOV8UOvKGSKSG1mYgq8Ybb+sDdjrinpnB5d4nQ== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 8435FE4329; Tue, 19 Jun 2018 02:59:43 -0400 (EDT) Date: Tue, 19 Jun 2018 15:59:40 +0900 From: Michael Paquier To: hemin Cc: pgsql-bugs@postgresql.org Subject: Re: When pg_rewind success, the database can't startup Message-ID: <20180619065940.GA31737@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 14, 2018 at 05:30:20PM +0800, hemin wrote: > There is a primary standby cluster with async replication, when large > data inserting into the primary node, we stop the database by > hand. How do you stop it? > Then promote the standby node to be new primary node and insert > new data into it.=C2=A0 Finally use pg_rewind to avoid WAL diverged > success, but the node can not to be startup with fallow error: That looks like a correctly flow, roughly. Did you issue a manual checkpoint on the promoted standby before running pg_rewind? That's necessary to avoid confusing pg_rewind which uses the on-disk data of the source's control file for sanity checks. > =E2=80=9C2018-06-06 14:40:18.686 CST [2687] FATAL:=C2=A0 requested timeli= ne 3 does > not contain minimum recovery point 0/DB35BE80 on timeline 1 This means that the instance used for recovery is not part of the timeline you are trying to link to. In short, the timeline history of your nodes may have been messed up. > (4) Standby Node: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 promote the standby node to be > primary: Here you should issue a checkpoint manually on the promoted standby. > (5) Standby Node:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inset 3,000,0= 00 rows data into database use > pgbench to:=20 You should also be careful that the previous master, as known as the instance which has been rewound and that you are trying to plug back into the cluster, needs also WAL segments down from the last checkpoint before WAL has forked on its new timeline. Which version of Postgres is that? 9.5? Because if that's the case pg_rewind in 9.5 is very primitive in the way it handles timeline jumps and 9.6 got way smarter. -- Michael --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlsoqdwACgkQnvQgOdby QH0oPxAAosIeJPX+RozUG7Qb0EqIWyx4pzXGiug33PvCQA0guX0UsiHHnaSe28Za leuBsfAgQp6rqUISk40dZjU5xVfZNi7WhDHyk0mTt2YFzw/Pebic8g9HIMFajVFP BNI7AmpwQNxDTigz0NlALgyCNwU8byWRG7k25jihS4NR6ugPGPvQDBvLIG1p5Ya8 V+h9lPsiH1nMiczPiW0qXOprgEgw1DQ3Fm8pnKl5D/72zzXl/z8etAS+Df6YraOw 7z+Dda08Cpbkq04azawB4bdLO380CBa1Mq1yjQUQhqQPUzdPMN9aYLWe8D/bkkzF aTj2sLORWTSOjGl+vjSHGvbo26tvWg0xsXdjey2hl5TlouQBktMzguS3+ejNzcr4 BhyVnTpuv3m198qDV3jx3eFF4+eEgOcnbo2xmGvCk7K9V5jKuEKjhgD1MQiPNmvo 0zDpiOjFQUgGRG7Nv1JvYIxHH3EzV43fxKlPmP28YWP2RXH+jdwCV3160AH3ZIVl p4gw7lMhzNhnAiT3U/t2yNJ42KddPFxpX7fC4r/vs/lRoQIXyZx6pfjCfbgRy4LI Ydc7BUVKmi5dMjPC/sNDSc/QTEayTayL7k1G9JkXObbDl13rDoRdUz+EP/6DJQVW 8LDucxWzm+sLnbqp5Iu+N1JlBPogywaf7ZCAwDVCZ6M24oYb8+Q= =VAXv -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--