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 1flwN4-0006UY-Lq for pgsql-general@arkaria.postgresql.org; Sat, 04 Aug 2018 13:13:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flwN3-0002Z7-1B for pgsql-general@arkaria.postgresql.org; Sat, 04 Aug 2018 13:13:25 +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 1flwN2-0002Yz-5Z for pgsql-general@lists.postgresql.org; Sat, 04 Aug 2018 13:13:24 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flwMx-0004kE-TP for pgsql-general@lists.postgresql.org; Sat, 04 Aug 2018 13:13:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0C8A821B13; Sat, 4 Aug 2018 09:13:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 04 Aug 2018 09:13:17 -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=50a4O+hC3zNIymFUPTQpo5OopUEwxnEj2iZwBoCoJUo=; b=jjwdixlm sdovodd98EijNvWDYBqj8+Jd6kDqjGwJryMt7yGP78W01RjWEXIMrT5MR0K7ekzF v+5b4dfulM2LfU+CBtpEHXxYzqBXvl7Mj8BK8mSFmb/y6Ch7ech6z7C3dKSUT654 NCxGJfXmWq6A+ipm/y1G0tJxReJhR3vfX5RSqJTd2gckAwuyWvyolAqLDBKhkJTL /dZDsCTy+FWpLOI/8ZTNK+R1wZxyDdasosNCiIv3u6PpamGouiwPUO7vn2jZOtaf VxZ6vNMhW1vS6gIMqkRTRs/auwCj9T/LHy0M1oTMnDvrbUj93v9XuojbWjzlkK3+ jnA/XUG9h6xOKw== 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=50a4O+hC3zNIymFUPTQpo5OopUEwx nEj2iZwBoCoJUo=; b=st4zGZ8DLaNvEukmv7PbWtXjiRtxU4BEHtWYTA6BQ9Ks4 qd/osMpgkgvzT/0RtkGKutpQlfkI6BsTMPm6y5cPFMMDxj2aElnpNdiDPbPyblwi T28mKbU+R/YYgJZZ4ZLLKdeY0TLPTbAhUe833Yyi9Fj601F9q2o6iENIK9Ri0Qgg NQgron0v2ZBqUbK1GHwkz0TlodkLnG4sadG9bui9vF/gepq4dyx02aGYEHgTCbY+ qrAE2HHdVAXDnoGlIxfMmGxirGPff7UqHC1O1nrRfRhfdhYa9wz9t0aeabAb58fH ToHjgiYNxF5Wav8G23jUUD0J/KfDmXHNpl9FNX2UQ== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (lfbn-ann-1-147-30.w86-200.abo.wanadoo.fr [86.200.114.30]) by mail.messagingengine.com (Postfix) with ESMTPA id 083281025D; Sat, 4 Aug 2018 09:13:14 -0400 (EDT) Date: Sat, 4 Aug 2018 22:13:12 +0900 From: Michael Paquier To: Andres Freund Cc: Simon Riggs , Richard Schmidt , "pgsql-general@lists.postgresql.org" Subject: Re: Pg_rewind cannot load history wal Message-ID: <20180804131312.GH20967@paquier.xyz> References: <20180803205922.GC20967@paquier.xyz> <20180804065654.GF20967@paquier.xyz> <20180804115945.k54bivte737gkicv@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J+eNKFoVC4T1DV3f" Content-Disposition: inline In-Reply-To: <20180804115945.k54bivte737gkicv@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 04, 2018 at 04:59:45AM -0700, Andres Freund wrote: > On 2018-08-04 10:54:22 +0100, Simon Riggs wrote: >> pg_rewind doesn't work correctly. Documenting a workaround doesn't chang= e that. >=20 > Especially because most people will only understand this after they've > been hit, as test scenarios will often just be quick enough. Well, since its creation we have the tool behave this way. I am not sure either that we can have pg_rewind create a checkpoint on the source node each time a rewind is done, as it may not be necessary, and it would enforce WAL segment recycling more than necessary, so if we were=20 to back-patch something like that I am pretty much convinced that we would get complains from people already using the tool, with existing failover flows which are broken. Making this stuff to not need a checkpoint is actually possible. When the source is offline, the control file can be relied on as the shutdown checkpoint would update the on-disk control file. When the source is online, pg_rewind only needs to know the new timeline number from the source, which we could provide via a SQL function, but that would work only on HEAD (look at ControlFile_source, you would see that only the new TLI matters, and that getTimelineHistory does not really need to know the contents of the control file). -- Michael --J+eNKFoVC4T1DV3f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAltlpmgACgkQnvQgOdby QH2t9w/6A52voB8xwFMyeWezR13MLlI3Q4G72QrCrLaFtEClcVLWz0LZKhpE5Np6 T10g2QgVhypD1dDfTzkDB5GeC7sUyymRT2qb0YZtN27S87VXt4FarCYz7aH3x+Ym fp/C2SGZPcU/zzIg+TmLzwibA+9cGCXXj4+SlKzLzH0SbMJlXEag9l/yivguS7Hj Rt3aDuQZnXj7b9sfwyYyLIRiEI8DLcnM8lDYAnzqzIiVcyV7BbOYyeKai4j1xsWq Fks6kLk923hCZdT33RGVFcI3FQX4vw34XbLYPm+tit0W1KDpXQ6BB3WbTofBNMbk 3/JmpMXWCw58q7HwmPyIJqMj5PirLVkukdZat1XUrQdFiqXxwXTR1oqFRScQBgqf qjxTM3W8HifMWWQNvL7it3vszVHRQ08l+tKEsp6nOjCPv4q/Nk7WhjoW5Wiiiab+ tWs/fnJRciXOOWujfn017aQnfFMRLPmJaXEnTaabSHLDyY2FT6qabDq+UsYLwJ6g 0t9Ir2AhlsX12V8xAsQaPL9w/RG8Pt8VM0vRxlYu2hERFg8KkX2YY9T/RokN+8Yc 9XYcvw15mTzGkA247UvMQiCAdbLfzqYl3BuuJuvHrGekOvnIvQmKwgXxc3gcnMFU /Zof7/XxvWsNVk8vBywb2buGraA86ZLTxpu5vhHsXeRRjqNm+do= =t8SW -----END PGP SIGNATURE----- --J+eNKFoVC4T1DV3f--