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 1h9r5T-0002Tf-P9 for pgsql-general@arkaria.postgresql.org; Fri, 29 Mar 2019 12:58:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9r5S-00011g-8B for pgsql-general@arkaria.postgresql.org; Fri, 29 Mar 2019 12:58:22 +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 1h9r5R-00011Z-Am for pgsql-general@lists.postgresql.org; Fri, 29 Mar 2019 12:58:21 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9r5O-00070Q-Je for pgsql-general@postgresql.org; Fri, 29 Mar 2019 12:58:20 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 25FB121EAE; Fri, 29 Mar 2019 08:58:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 29 Mar 2019 08:58:17 -0400 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=86aOOEOOvqTsRu9WLEQGIY1Y/Hk oGYsr4aD6xWb9EP8=; b=JiMX9xjtrFl7w0WcKqeRTJetz06hypLTGdYdfs1lEp+ +Qi9W1Y1MJNhijOoosUMgmitwIqrCMyDKu/atuhkZX4FP5z1e2BbXAkgo4VS19mM ab83qip0TxzOKXt5yWSDQg/NatEjJVamkwblJnWTVoUhthrf0IYO4FC5WuHGL8Zd 5KMmpd/DC5ZS0em4W3wukLHKC4e/hj4zqKXYpctXHT6lyFDpA289K7ih66sfNoaE UcABWt5teT8rqjwMz+lCcBY3/WNefpeGzh7jd17enlxyyCLvbDVduewsIAPWr9l1 wpveHnZFn21yEaBq8D9kJ0qt8UPMAdhRvk8G4nlSHWQ== 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=86aOOE OOvqTsRu9WLEQGIY1Y/HkoGYsr4aD6xWb9EP8=; b=QF079RpQ4bcbbNR+P+GHac 2CK78+HCnD6QpljHwlsGQt+7UcEZ9QwHpt1mAmLbERVL/1qu3R27cevMAHESdDUw 5LO/J7fCQM0dlhFzveBr9/IDhuJGSocTKgZa+wueLNy6nVCsND4CJO2t86ptZtgl Hs+9RPqH8nOylhavl7UKpxRJm9+WNz14Is+2SzsM08mbu4YBzzjoTaf41gUIIpT8 TDNiJS5LlChHzKbXdPw9oIMoSsBmwjRHdUpjOA7PaD4erSnROZoKv5JSX3BgQnKs nXNMYNRcRno39lh6Vdbfrjaaa3AgqvywdYoLI5ERWju5uUcbT4eJnTXNpAMKKRlQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrkeejgddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddu necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeeiuddrvdduhedrudefjedrudeivdenucfrrghrrghm pehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 0811FE46C1; Fri, 29 Mar 2019 08:58:14 -0400 (EDT) Date: Fri, 29 Mar 2019 21:58:11 +0900 From: Michael Paquier To: Rob Sargent Cc: Adrian Klaver , "pgsql-general@postgresql.org" Subject: Re: stale WAL files? Message-ID: <20190329125811.GF1954@paquier.xyz> References: <10FF70E2-9F70-4469-A4F4-4081988F0204@gmail.com> <3dccbbe4-e115-11ab-2d78-74c3cc9e2e43@aklaver.com> <599C6022-1DA1-477D-895C-7E217D350B85@gmail.com> <20190328133005.GB2558@paquier.xyz> <973f0fdf-e20f-a8a1-86c8-7f145eb31b70@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hcut4fGOf7Kh6EdG" Content-Disposition: inline In-Reply-To: <973f0fdf-e20f-a8a1-86c8-7f145eb31b70@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --hcut4fGOf7Kh6EdG Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 28, 2019 at 09:53:16AM -0600, Rob Sargent wrote: > This is pg10 so it's pg_wal.=A0 ls -ltr >=20 >=20 > -rw-------. 1 postgres postgres 16777216 Mar 16 16:33 > 0000000100000CEA000000B1 > -rw-------. 1 postgres postgres 16777216 Mar 16 16:33 > 0000000100000CEA000000B2 >=20 > =A0... 217 more on through to ... >=20 > -rw-------. 1 postgres postgres 16777216 Mar 16 17:01 > 0000000100000CEA000000E8 > -rw-------. 1 postgres postgres 16777216 Mar 16 17:01 > 0000000100000CEA000000E9 > -rw-------. 1 postgres postgres 16777216 Mar 28 09:46 > 0000000100000CEA0000000E In Postgres 10 and older versions, the server keeps WAL segment for the last completed segment, and the previous completed segment. So even if a checkpoint is issued, the current WAL insert point is never really going to be on the first segment in pg_wal. Isn't that the origin of what you think is a problem? So, say, if you issue a checkpoint again, don't you see 0000000100000CEA000000B1 going away? In Postgres 11, WAL segments worth only one checkpoint are kept around. -- Michael --hcut4fGOf7Kh6EdG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlyeFmMACgkQnvQgOdby QH0PFA//Y+xzUcpICDpX5pOWBHv6O/gTvscBbVpElP47u8gxsxWpIuKvd6PCUviE aQF185+/nKXvXaHOLEyaJR64luyM3cG9Kne7LRFlKsGdQH/TCC0IQN1oKRHf+C2Q cY3kWlLNs2xfQfi7fLYG9iDZ8ZyFWiXBOhTpp/pn3TyHJxTv8AeXzJGA5kfpR6bk 3Vz4TRiaRUWPa4Su7Ddv1w/6enVUsUj5j73p5G4Nr8+N1haykDM28LjY3281HDQM SGaAl2PnHalFV61279/PY8Dzs54XlbmuXFOGGPTAKIKIECYsYjOwOfZOJ62D5BNw +G47X4QGHZWQbkRmqn/vLf+j9KWGui0tnzWZxZmOfzwvAmCkeb31gL9TXqMOxhjL tv7wf/jE/swnAa6Mz1CF+AwHRUB/u0EFYyb4By8Ri2q8LFW+LfXcrs3Yp0psLE7t zhYHVYJpoAo7/hdffg58SkOWOGhTo1fT+yOFVv0f0FuMCx1OU8AYPcVtTUjZtlG+ 1mzRO2LWIn0vCRrl/bdtTAylD1EuvYrpjbFrmON/LGmWXvB7NqVrBY+fs0OK5pIv k3X7pYngTaJn60818O9kYOEC1OEQBo1kmznLbKNZcMQvVDUX1p5pih6ro+ibK7Zh PE48Fjq1mkMTPdIzVbWgVsXJlhzphP7qKHWDcY5SaI5cP2SZsIg= =64OU -----END PGP SIGNATURE----- --hcut4fGOf7Kh6EdG--