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 1gvXix-0000OH-Eo for pgsql-general@arkaria.postgresql.org; Mon, 18 Feb 2019 01:27:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvXiu-00088z-Lb for pgsql-general@arkaria.postgresql.org; Mon, 18 Feb 2019 01:27:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvXis-00088s-Tl for pgsql-general@lists.postgresql.org; Mon, 18 Feb 2019 01:27:56 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvXim-000749-7z for pgsql-general@lists.postgresql.org; Mon, 18 Feb 2019 01:27:53 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8E8CB202F2; Sun, 17 Feb 2019 20:27:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 17 Feb 2019 20:27:47 -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=fm1; bh=UOMlNA6tnXBtE4nagRUtB2gtLAA sCNqUglDKBtjK+8g=; b=Ns6liMNV2DYQ/Ya7k/NwZ3y4NH+rq7spm1BOnaFiTkZ +5TfHJdHtXDpInCF3M7ZJg4traSQ8LDmwlOlOQQlmUyNydo+nFe8n+lAVS7gPkB8 BBMOdjTymLQKnkjtsTpMTDiGrbyZkF0XREG0Bduew68Qo73cnqr9aBxLpF7wRoYe ALWf97JlkqfuHuntkMKQavasdzAU/P/u5S90wMeft29OPEq6mf7Zhb2bhRS42SLE 4BeRkRlSBi21ewh3+YpqxMVw/bz5t96P6NoEkjI0XAOBP/EAxK1y2oa6ir98qiVA PU6H5boa4RPwwQPs1A5JS4eYSBx9kB/UwbfMKmzPM+g== 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=fm2; bh=UOMlNA 6tnXBtE4nagRUtB2gtLAAsCNqUglDKBtjK+8g=; b=fDPdPdOuGFdfEVZaPfB1ZA M0mS7k8cIY8dIplsQtVuMBDOWxhh7RnEhE7Mnn0ikVUpou0N4VSaKJx61ROgbftz bGMOxz7RHUbJ0gckcJKSYjlmzpssc6OmL4jISAdG/yNFRzhavvDS6d+IV+5RxKJ5 iQZFkdxjxISRxh8c2gTBqaxex+3gsyU463N6IPDTg1ogmcrvxc6xjK73F/iI8hVl EZjYyq5jTMP66bGn2wUz39A2P5auHIE99uZ46nacNB0jiH9dVcW/eQxYGdkchHH5 08RWMFfE/gG90BdGZfEXxKk06XBTeRsWnol7jMcvkGY5OUivMipCr8W12ZCY58AA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrudduvddgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdejtd dmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgt hhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqne cukfhppeeiuddrvdduhedrudefjedrudeivdenucfrrghrrghmpehmrghilhhfrhhomhep mhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 7E692E44A7; Sun, 17 Feb 2019 20:27:45 -0500 (EST) Date: Mon, 18 Feb 2019 10:27:42 +0900 From: Michael Paquier To: Andre Piwoni Cc: pgsql-general@lists.postgresql.org Subject: Re: Promoted slave tries to archive previously archived WAL file Message-ID: <20190218012742.GH1864@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wayzTnRSUXKNfBqd" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --wayzTnRSUXKNfBqd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 15, 2019 at 12:03:39PM -0800, Andre Piwoni wrote: > My slave nodes were created using pg_basebackup with --wal-method=3Dstrea= m. > If I understand right this option streams WAL files generated during back= up > and this WAL file was 000000010000000000000002 but its contents were > different from what was on the primary and in WAL archive. When I changed > --wal-method=3Dfetch which collects WAL files generated during the backup= at > the end then diff did not detect any changes. When I failover I don't seem > to have the issue with new primary to archive. >=20 > It seems streaming WAL segments created during backup produced corrupt fi= le > based on diff. Nope, --wal-method=3Dstream and fetch behave as they are designed for. "fetch" would include all the contents of pg_wal/ as part of a BASE_BACKUP command using the replication protocol while "stream" would make the base backup avoid copying all WAL files, copying them in parallel with a secondary process which uses the same facility as pg_receiverwal, in which case the set of files in pg_wal/archive_status/ has little meaning. I am also curious about the way you use to do failovers. Let me guess: you stop the standby, delete its recovery.conf and then restart the former standby? This would prevent a timeline jump at promotion which would explain the conflicts you are seeing when archiving two times the same segment. -- Michael --wayzTnRSUXKNfBqd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlxqCg4ACgkQnvQgOdby QH1M8w//eD0hyCarbphwSlO1lmbQBS5JqpAPRRt2Hfs/jkc6rJ0J53IyXQCFrBAc 3kURtQY9Xii6PJ16PBxWiMl7ZPnzWzpeDThrag0ptE/lhf8jnsjszysgQxFxSQMq s4KlIqOH7UX4GQwvsGqUCjsbU0aGkfF0Q74b6VqpJvqZUElm/ojk2e4rtngyeknm greZCdPeE2uPf3JY6ecBzF/OiERYG3vGFGTq01OgiCuT7QXHrUAHvzxFEV2MZ8Y9 ZLooQ7khnskClmZjPoNlbJLCrWozm7frmFRU1WMg0LEq+1PgwUol7s/dOjt3uJfv uzSmAuzAPxa7Tv7t7t4vUP9X42U/RM4K720++ueWq+UjIOhm7QCuld4eNZ7qbPR7 Qty3WU8EXSAzqpCrcCG5dTAnWYiIFhEkeL4CjkIVS/AnFX/jhLDqTUNVVJlOTMRH ODDRI9ivapj+wBpQyC/yiftuozFg1U9d5EkszuA1GOOClLR9Rz7UX/22JjpzF6xS CTwZJDe+7loX5kNoiE25hj+R1F2/B6pAhWUA6oRJipi1kG3sd1vFHDULdi30K9eb MJg3THyN44fmtQ2RMG5XB07P9s7USl4Y0JDaGmaIwE7fBWCTDaAXQrZv2uqwUxFC KzzhH9FYE65AJzCNudsBT5zFyTSfNhhwpjdEqRMVnVfX0nhvbSg= =StQv -----END PGP SIGNATURE----- --wayzTnRSUXKNfBqd--