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 1gwgPC-0000wF-Lm for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Feb 2019 04:56:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gwgPA-0006pj-33 for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Feb 2019 04:56: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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwgP9-0006pc-Su for pgsql-bugs@lists.postgresql.org; Thu, 21 Feb 2019 04:56:15 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwgP5-0003oz-Io for pgsql-bugs@lists.postgresql.org; Thu, 21 Feb 2019 04:56:15 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7B2772223F; Wed, 20 Feb 2019 23:56:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 20 Feb 2019 23:56:09 -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=q6h867078RDIuggUePvf+0Sp1d0 iTze377Ht/K5bDSc=; b=QpvoovmadoMSSLmpbSLdjQXA18vLdKI0HYOEk2KA6F5 NvVccZjD7F6z2FXkju+jm+KdWDbI/38KbDRLCok//hmoUJukdUA8YiUE7Leyw2b+ AzBWhutkKsqWDSyNLgvHwG1qFpRZi6yVO5Lr6/wlPtCEO+mek2eG64OntcQno6Yp Dbfh4UcWjFNGFMwQoU/THVKuXGoEn4GdEgaha3/n2stz/bc4RaKx33/IiHtMhiwd i9WWf0VkzCmWWyaeVNTYGMZ8Ej3LcOpcqV5zKSdHtjWr/8EAz4ylJrzbNS05JlOZ ydI7/rY6yQBXqRZhRw6t2V09LlOUFClvMqDe29uDW1A== 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=q6h867 078RDIuggUePvf+0Sp1d0iTze377Ht/K5bDSc=; b=DGmY/wu9M/aqaGt9vrGInS Z8TiunWlwga/8TskZYvl7LD4iwXKE4qjgbe16AvLw7EwEuN5vY/XB4XG5tomHpc4 AXFbsTTAFmwdihQrVt1tjruVWe26ei6ykhIPnsp0ixd26aTdtX/mgoshGvT1ebtT FN2gZGtnmiZWb5sIWgWgD2Ala+yOkcul1lSegIi12ova6Sb/Xx6ys+Hc0iLa3lbr WOnY1L4mSASb6p5xdByAMuW29yCNZrzR7HphBN41YIHiW0cjHYIx5yLRnXOXK4GZ Hur3ENEQ9DxOIyzxnme9+yib8OwMpF+geaXvpG4q6eBw93aA3XlJg5E/WPXH5Dug == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdejieculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlvdefmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdho phhsuggrshhhrdgtohhmnecukfhppeeiuddrvdduhedrudefjedrudeivdenucfrrghrrg hmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhu shhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 487721030F; Wed, 20 Feb 2019 23:56:06 -0500 (EST) Date: Thu, 21 Feb 2019 13:56:03 +0900 From: Michael Paquier To: Andre Piwoni Cc: Maksim Milyutin , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectly generates WAL segment created during backup Message-ID: <20190221045603.GM15532@paquier.xyz> References: <15638-426547bdd97938dd@postgresql.org> <20190216152503.GK2240@paquier.xyz> <20190220035011.GE15532@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9rkt7tfZQigMla7f" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --9rkt7tfZQigMla7f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 20, 2019 at 09:58:12AM -0800, Andre Piwoni wrote: > Also, what do you mean that my archive command is not safe? It is straight > from PostrgreSQL docs and other resources: > https://www.postgresql.org/docs/10/continuous-archiving.html > https://www.opsdash.com/blog/postgresql-wal-archiving-backup.html The docs are not the best thing on this side... One immediate problem one could note is that cp does not flush the segment. So if your host crashes before the OS flushes the copied data then the WAL segment data is lost. The flush needs to happen before the archive command returns its status to the server. > It seems you agree that segment created during pg_basebackup with stream > mode, which is not marked with .done extension, would be attempted to be > archived again. I also understand stream method during backup is default so > changing this behavior may have an impact. If there's any free solution you > could recommend for backup strategy please let me know. pgBackRest and repmgr are tools mentioned on the lists. -- Michael --9rkt7tfZQigMla7f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlxuL2MACgkQnvQgOdby QH3xkg/9GQcWjspgikbOqMIrHDKOkKKKK+qctph1AyyQ6hUpDOx8ldQGyv+0sWZ9 FWoXN43dJdEzKDWQK3KQgYhqaugUyXQzjY1TzgM+H1xFeBmS8HLNYgiCZ3KSFC02 yzQ9TL+l4pRILqN2/2nZTTH7pZE7bKnbGlFktwqqTorJTCc15uRACJ8qBIwqpVgY z77EQxs3jBqKpkHXSHFeLi5v5O4W9vnyLu5Z1JVfeCOFAI8DmL7ArW5vxAdLEMyi JCH23NXAs7BFeWUcinf2PYieevRTXvGo1s3OSgp6O8N2xp6xztin5dfy6lvAQJO7 zIzkklNdAX3fvrjDk/Tj2cVtyRfYvY7KUWHc+lOKa5uSNpQdHKxWLyhkntQb67aS QP77Lq4hVaGdrmofgTQ3z9nOtXazi1EHUds+9e6Dipj8lwoJ42jX/lnPO0wNHWZ6 tQyiuAQhCB1jkO7OcR4qOk8s1G/D8vMTgGVNycuHQ95amGxKgtBUWmitOfhMm3Bq RDiLXQNJj5DBQy+p7I6eWNCAh0ig3ZXHMmMQhBlBZji5yovms4qPqiANWKSyFM6+ baJdobim5S/1bhE95rB6WP+bqMqmsscov/U6/TPQJEXJ/9TNBxXs7yxgywmkAVFx xKchXrD1d4c4iIVnnPhVQqBrCAiAF0AL9mkb/RgRb6qeIjy0j3Y= =ngj4 -----END PGP SIGNATURE----- --9rkt7tfZQigMla7f--