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 1g5j2u-0004DQ-ML for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Sep 2018 03:02:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5j2t-00071Z-0l for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Sep 2018 03:02:23 +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 1g5j2r-00071O-4n for pgsql-bugs@lists.postgresql.org; Fri, 28 Sep 2018 03:02:22 +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 1g5j2l-0007jO-7w for pgsql-bugs@lists.postgresql.org; Fri, 28 Sep 2018 03:02:20 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E286D21B4F; Thu, 27 Sep 2018 23:02:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 27 Sep 2018 23:02:13 -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=aZ1RVWPLRMmDTjBt4toXNyjFXEM0KpFeZa26vwkHnRY=; b=5XSS2KKk gbS+tgDTfzkyEc3wMYrqv2QSoXFyASS9bMqQoAwiWvphi5M0uy9gOFVb4ZiiM4c3 1HTBfx+13kPOJomRjK3wKulPjjbPS3XMETrUw9PgyJxmkIPkltYCtcUsok4jFGMt aFBdCC8b2OgQpG0Ilo2krIvXNbpS08GPvb5nPDKXxWXqvSnNYG5hxKOEraFefyKQ hRaKeVq/vGpO01szSYIBvrCXvZ2v503NIsXvlPhw7UfYPsWBhAIH0F4YmQ3sqZd5 d/J0RJJZxbJ/DHuGU35mkVr78WQ0uUTQKUzuQpY+GHGTjaFaPHFskkrdzBH8IzzD eXxh8qGVPg7nCQ== 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=aZ1RVWPLRMmDTjBt4toXNyjFXEM0K pFeZa26vwkHnRY=; b=G654tgj0fYZRsA1JnOqFSiJq4+Xq4iKymEc2SAo2o0HL6 1moeIfwhfcvffhEelkIsZ6/4PXAJ2FnEUs5XaipkCCpGQ8Uqvpi9rIGjAbkuPGzn Re1x4e4i1FUBsW98Khl0p1b8anURA7ntqr/R1Y5Nn7pDqNMfaXDgg6vjP9ggFbyu 5wW7W11bgjt08f6q2g0eVhn9Z04tZHfaUQoT8m7oXo5g+YPllFisx8N5DV1AEdc1 qM0EOnvu9KNDLIkme8VhDXJB4JOQSMnUReGHhtRCtdMMajriJHQt04ZA68XDIMDZ mRUiGZvV9hn4bAf0Dd11pg9AUqsIZX7ck4jZjUJ7Q== 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 64E8D102D6; Thu, 27 Sep 2018 23:02:12 -0400 (EDT) Date: Fri, 28 Sep 2018 12:02:08 +0900 From: Michael Paquier To: TAKATSUKA Haruka Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15402: Hot standby server with archive_mode=on keeps initial WAL segments Message-ID: <20180928030208.GC1500@paquier.xyz> References: <15402-a453c90ed4cf88b2@postgresql.org> <20180926035205.GJ1659@paquier.xyz> <20180926133640.99bfbc7ea82f71aa91a02c11@sraoss.co.jp> <20180926141236.160707712aea82341f01b03f@sraoss.co.jp> <20180927044430.GP1659@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WplhKdTI2c8ulnbP" Content-Disposition: inline In-Reply-To: <20180927044430.GP1659@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --WplhKdTI2c8ulnbP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Sep 27, 2018 at 01:44:30PM +0900, Michael Paquier wrote: > I looked at this problem, and I completely agree. From what I can see, > the restart point run on the standby creates a .ready file for the > oldest segment because there were no .done file present in it, so the > checkpointer thinks that it should mark the file with .ready, and then > makes it ready for archiving, which is never going to happen with > archive_mode = on. All the newer segments are already marked with > .done, so they are getting recycled correctly. I have spent a couple of hours on this problem, checked the behavior on all branches, and committed the fix. Thanks for the report! -- Michael --WplhKdTI2c8ulnbP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlutmbAACgkQnvQgOdby QH3dGQ/+N/NbrToMaaeCAEmXFPEj31U57kYDrghAVsaFI/fLIT9a266DvsOSAc93 4xz2f2MGyKna5u+jb3ZCs1ZrBxmJFbeCN8gPR0j3IN1QQPFN590JHZJXwHUi7Ckv +PTO+kfVCHMPy83mmuUcRZ1J7e1LzUi8QAIjUkJPI6MxN2//kz/MEUcXAMo8pnON mZUmrBSZ9rZGQZ7WJ0y8g2gXSOv4prWObsJ46/8NgMB2CBQKjUBjov1tTnNOeb7R 4GYESf4YkEtHzxDjIMyapa+d2hap3yIHeeAXGcsMurQhuurprBibaxWmlkFSg+my b+p8Hef6BrU3xCzEg6iusVhg5bRQtbtxCntU8R2QbKHQp8ShHbRcAZWgesy01/Fd Wr4cFJMDilW7pC+MlQO/im08aysW3ONbGWLkEvuIt1h0u8ykYAl/8nY9SiJImksF 5KnQaJLJsRuctMBHbodjR/s3/dn3oVyU0aEjAwU9aOljqre/9oaPHUixrU5bI4mW 1MNUvP0kGk9/sopspXuT4/+SBIInAxIrfA1ybktgc+K7fJ1JTWBhlJs/F1jGVg3o Vkk3KurHWskw/gD/7CsTV31FPXv14eiO8NcNxV8rFvngsa+nrpEeGhRjvSSDhLo+ zX+J0z6jJxpWD875ZXZji38QR+p0I2BlIHer0W6mvpWsgiaAkpk= =d8l8 -----END PGP SIGNATURE----- --WplhKdTI2c8ulnbP--