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 1gv1q5-00080u-QY for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Feb 2019 15:25:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gv1q4-0003P5-GW for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Feb 2019 15:25:12 +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 1gv1q4-0003Os-6m for pgsql-bugs@lists.postgresql.org; Sat, 16 Feb 2019 15:25:12 +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 1gv1q1-0000wj-OR for pgsql-bugs@lists.postgresql.org; Sat, 16 Feb 2019 15:25:11 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F1E9721BD8; Sat, 16 Feb 2019 10:25:08 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 16 Feb 2019 10:25:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=JOuQEZ6ySf1J5LmkF+xwk6eNr2I 65KPw2tE4ecpqVA4=; b=ZS3O8mx8bLSL2z5bIkP6dMM4uvj8YEju7+XXoepM3tx e446GNA2TxzJ6z8phrTzugMuTsdrpw5qqGPQfYkCbPO1mYDXQDU40/m9aXUIijHi bHw6zmo5bW6U7rx6pdwsp/WLnYbSeDY1bUQO9mxKwm3V49xGd4AMQOaINzLt5dvG NCs0jlF9ATi1Ilhadbti82XxVDLNk9lOAEbhhOgn7LWKTBY9Qne2djJ3paGZSfx5 zC6tRtOqausEoMGVea4ux6u2qLRbxWlYVdO8np2gEcU0K8lSHHF7utOQRrLfxUyE y+g9JHnLE/MVn/Ri9uFyaSeigtruxsHxrSttAalpfow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=JOuQEZ 6ySf1J5LmkF+xwk6eNr2I65KPw2tE4ecpqVA4=; b=NgwZsNn6l9+QD+Rld+pOki vl+jPiZhf8mWgEowi1E9S+oWvz5Iy3lp5GD68pluOBmbnMJQbjEUHlgLV2JPa1sG ToBpDqEDPJtnoLRro/9gbB9XZYq13h7s8e1B81T5QIu/UsdEN5pelnlLBIp+ZJLv +yN2XpsjiLvbrFOb4MO0WE1W2uwbUGffTnq5SjU3UhM4DzSJ/w4KJ5fcFgR7nsFw svlx88NxiubProJPUyOnIjAWWQ10zeeGO4DAClzEvsy7TBSYudYCd9DfKk/r22FF PTmoXlg1liuvwbpqBrlWW8znK+4MWANgiFLejmCZJVrZt1zOgb8uqSEC0D34uZ3g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtledgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtd erredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggv lhesphgrqhhuihgvrhdrgiihiieqnecukfhppeeiuddrvdduhedrudefjedrudeivdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiien ucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 9BCE110314; Sat, 16 Feb 2019 10:25:06 -0500 (EST) Date: Sun, 17 Feb 2019 00:25:03 +0900 From: Michael Paquier To: apiwoni@webmd.net, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectly generates WAL segment created during backup Message-ID: <20190216152503.GK2240@paquier.xyz> References: <15638-426547bdd97938dd@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2feizKym29CxAecD" Content-Disposition: inline In-Reply-To: <15638-426547bdd97938dd@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --2feizKym29CxAecD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Feb 16, 2019 at 12:26:13AM +0000, PG Bug reporting form wrote: > When new slave is created by taking base backup from the primary using > pg_basebackup with --wal-method=stream option the WAL file generated during > the backup is different (as compared with diff or cmp command) than that on > the master and in WAL archive directory. Furthermore, this file does not > exist in pg_wal/archive_status with .done extension on new slave, though it > exists in pg_wal directory, resulting in failed attempt to archive this file > when slave node is promoted as master node. > 2019-02-15 14:15:58.872 PST [5369] DETAIL: The failed archive command was: > test ! -f /mnt/pgsql/archive/000000010000000000000002 && cp > pg_wal/000000010000000000000002 > /mnt/pgsql/archive/000000010000000000000002 How do you promote your standby? In Postgres 10, the last, partial WAL segment of a past timeline generated at promotion is renamed .partial to avoid any conflicts, so as this should normally not happen if you do not use archive_mode = always. Please note that your archive command is not safe. For one, it does not sync the archived segment before archive_command returns to the backend.. -- Michael --2feizKym29CxAecD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlxoK08ACgkQnvQgOdby QH05Ew//fF9epmDrSM67Bddoa4EYMNe88GbeWzodHTEH8/BPOvzrSaMPTE4tsGmR ot3/sDkb5OCxlGk9xSbKmb46ZlfY2yVm1BCqTa0uqBzN04Ny9yypyEos+U6vyLUH RMztgIbioSuF8QJG7P7svMWU2GvCtah3ChQP5JuOHYcsGNUqT98TXPgxrhSKravE Y7WEqtgJktxgnDXTWXlOUDVZN/LtXJeVDfc3cORk42nAH2HboYExU7FKZBkMb0qN atERLnKlkUKgUpf/khz6acjff23BRCmZIwivlPTloeh5VRk56v0oE5jBbMyzGjyh JRsWfOSl2BCxS0GiYoA/b0rTD0ZzhHcv+cBuYDqk2fSRCACJ2OtdFCqXdU6HCNxU HrMd8Dkw+BzinQwKYY+ykAl4HxGLN2wjoY79fThjRsl4sdCT6mEacExhCAqqQtKo f30BVdiT6qzGxFieVzZq5N1Ag99MOSspAGDTg/jNtlWKtxzoeaSVJCNpOEE2meIf kP7WJSeP7Vs9Jx89jXVJJJN4XP3B26mTLZ374gqVtGlrb7bxmtM65u4amJz4Fa4Y 0Pc+kxdbtZ1YNK1dASkhh4BqQI+bvbN15dcPd4irBwbfRQ9v7gEEJABLoY9t4IMN p/s42kP/ph4zLEjxX27Qos2K5Agv0Wj2Foo/+UUc1av4d+Fzk/s= =q4/o -----END PGP SIGNATURE----- --2feizKym29CxAecD--