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 1g50s6-00026w-6m for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Sep 2018 03:52: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 1g50s4-0004WN-2s for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Sep 2018 03:52: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_SHA384:256) (Exim 4.89) (envelope-from ) id 1g50s3-0004WG-Si for pgsql-bugs@lists.postgresql.org; Wed, 26 Sep 2018 03:52:15 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g50s1-0006hw-Gg for pgsql-bugs@lists.postgresql.org; Wed, 26 Sep 2018 03:52:15 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 209DC416; Tue, 25 Sep 2018 23:52:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 25 Sep 2018 23:52:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= 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=iIHSK+jQSoijZvGbAJPxwHolNsjXqR2QcIJSy+lT9gA=; b=F39vifPG t3J0gvis2ZjIy6BzncG1dnQQhT2cLoAV99899Zwf9q9aFaHuyyS1YGCHWe2hp6gT 5FeB2DmjzcpUgrr4au3xT6VCilXLmIm3VM/urnmPLoCum9ithBjplRSDPoyBB/bT vnyOn+0LlXnglXwsJrwx1Lo9GZR6RdAG/5iKmbAze+uFZyL9mT+2wgZIPAW8Y2k4 UCmeEpfP4nAR/nKRJ00OiR+TahY7v9K8NGXs9NhdOMMnvFOLVtPOccFzGqV0kvOe zdxpq2MwTPeKhcfV0ThLSdEYqs2K9eAQwO7rFIEjUueSbiQ1fLkVXQVK+R7f57o4 Dw4bZqy/ycCfnA== 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-sender :x-me-sender:x-sasl-enc; s=fm3; bh=iIHSK+jQSoijZvGbAJPxwHolNsjXq R2QcIJSy+lT9gA=; b=aZV6KMKXoys+UoCu6WxQC52LD96fxKeRj/sZreTqWaKIv SXz8yRKfJLIcjs8jBuFB0cB1MoGUXPkhboX/CVh3tCz5NNi1MPfp4FJqtMqEFIiv edShfnWepdaAbzIldys6PjIuw+GN838S2o0dBhL8+VsvyeQNSoWJO+jBb+yZXQtX aMZgn89GzpHdaluHZAl1edAt5JzR4ZVrGOnxVwdvYfp5d4HCOcRa+0+fSLLhpT6e 2iBw8mQk+D56zJgxrQBkAPjNrgtm/CWXoLu2jR+E32082G8XBRTTQqlmRjBEq78x gazYtdasnmxWH5k4cQd6sCeDzMLz+pWCy39gHtDTw== 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 C1CB5E4149; Tue, 25 Sep 2018 23:52:08 -0400 (EDT) Date: Wed, 26 Sep 2018 12:52:05 +0900 From: Michael Paquier To: harukat@sraoss.co.jp, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15402: Hot standby server with archive_mode=on keeps initial WAL segments Message-ID: <20180926035205.GJ1659@paquier.xyz> References: <15402-a453c90ed4cf88b2@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iSeZnk6FyAS3EJ1y" Content-Disposition: inline In-Reply-To: <15402-a453c90ed4cf88b2@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --iSeZnk6FyAS3EJ1y Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 26, 2018 at 03:26:50AM +0000, PG Bug reporting form wrote: > A hot standby server with =E2=80=9Carchive_mode =3D on=E2=80=9D keeps ini= tial WAL segment > files that copied by pg_basebackup. It shows the following status. > 000000010000000000000042 will be kept forever in this case. How did you find yourself in this situation? Did you take a base backup =66rom a primary which had .ready files in it, and those got copied to the standby's data folder? We may want to study the possibility of filtering things when taking a base backup instead. > Though I understand renaming the .ready to .done manually can clean it, > I would like to fix the server code like the following patch. > I'd appreciate if you would consider that. Your patch looks incorrect to me to begin with... What if archive_mode is switched from "on" to "always" back-and-forth and there some of the past segments which should be archived are not? -- Michael --iSeZnk6FyAS3EJ1y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlurAmUACgkQnvQgOdby QH0iHg/+IzedtV9T3Tew+kot8LC0F0CGHbCKqy2nWaXwRm66Fwz9hu8U3cLIqrYh Z0V347Oz/H5AAZTYiFQcv0Y95Rfsvnir+JaFZVlsxFAGn/SJwX4+9xJcEI2RPYpS qHNNvl9VEdA6ZIAQsZEPHk0HM+ZDZmfbHsiZrAlskAYKH4TzQxmyBaLwvEsgTID9 uJzMEN8lh++V+4lQTPtsSUrRsmecvpqDS3jyH4htI6DQ81yotYf3JIzK1o5wy8G5 A0krTqNwUUpK+nQa48wBn2pl7I5IBXa1bSn+ECx7OCrrRNDLeSYlv57KfLtZZu6L 7NVF+Rk2U67aelfvueWsc3na1s4Nf5BLAloiwcKKvHjOPu8Osa28G6dvfElqpLsX kHN3ldmbRj/6NeL/nhYFGLcLWcI9Rid9oNegZx+GMUl0OK8KUgKIkcIIMOwK56JW OAsMdtjZoqAn30LLitieYc90EIgSjon8XwzC4nLwCL3nuSFg/2DD7U3FyJ3ewaMu D9kaawdv0O/GylSxxslkLsgD9H03fUKXDl61o+ggkbE20L96vLzDj/ShM30sIoEb LSz8OwKSCTyY3NxWLlb4Gmk+Ke8n3eI/TiFOS/lIkMThORRk8zOZcwwHP3wJT2BK LcpfNw9DIWzcAbG/OTU5X98gHgwfQ8u37dBoxsKExu05YoZZLjA= =quZf -----END PGP SIGNATURE----- --iSeZnk6FyAS3EJ1y--