Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8ep6-0001mo-4E for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 04:36:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8ep4-0000dt-UF for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 04:35:58 +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 1f8ep2-0000dj-UA for pgsql-general@lists.postgresql.org; Wed, 18 Apr 2018 04:35:58 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8eox-0003jY-AB for pgsql-general@postgresql.org; Wed, 18 Apr 2018 04:35:56 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A053521BA2; Wed, 18 Apr 2018 00:35:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 18 Apr 2018 00:35:48 -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= fm1; bh=YK/kqgvQXP14pSbOb+wuepOkXEgQ13caXYTF2rdCFt4=; b=ueuRiTzn 8sazz7tQq296E/I6RTtrBlsOfrF3UBXP9WCPG4rmSivWbU57qoKSAE5NoU130JMe FNK3nOVykjwLLcgXptbJZZ1vR8k4hMBtugy+TSy7+/3RwTvwqmwnhsqhslIL+Ty7 o7EYMyI5eVQS1atrEbuxym51c+c4XsNFzKcwOfy9VlBA4izdjG5Ryp6oUqH7Oq5f ecbukmmPsGS8vMXiR6JT7eiASP6wlbMi9vVTGaQfrHKX8SnSkr5h6JYlqnDiBJis rZy5bbwpU7n+DuKV7J4EW3RK1+7GKBVFwiWWT333SlfoQcacMA+PaTViTVrvzt2Q DVenFVFE0NMPMQ== 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=fm2; bh=YK/kqgvQXP14pSbOb+wuepOkXEgQ1 3caXYTF2rdCFt4=; b=a2V8y/u6eJS6UKFm58Ak4PFfuas0sbnTVpLDNDdidY+JH WPlpbdEsDPe7fg8jiK/cATFMGxTFSpe8SO79ULTtHut+vR5NlW1M494OlF8ZhV6a 7auQauHK2YjDdEO6J8xoba1q6aGt5vz4bh1SRQ9Ke0Ff4Fi+rmuYUpmNlDZIpXc0 xaoz0Mo+CL0eqYiy80dCwggQ58QZJD4faotTzTc4w/5yKAtXh4/dGVDleOY5YRhj OAzbi9E6E6sn3eaiWLh8+doYh+nPXogWTNSEDITj1u4XNLqNUBaX6Sd9hyhQVddB 1e2JSG844L7SdOdN2e9hQwKRY1W1TfW7nT8hIw70A== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id B1A67E43EC; Wed, 18 Apr 2018 00:35:46 -0400 (EDT) Date: Wed, 18 Apr 2018 13:35:43 +0900 From: Michael Paquier To: Tom Lane Cc: Alvaro Herrera , David Pacheco , pgsql-general@postgresql.org Subject: Re: Can PostgreSQL create new WAL files instead of reusing old ones? Message-ID: <20180418043543.GI18178@paquier.xyz> References: <20180417182013.zi3wghrvyspiatkh@alvherre.pgsql> <2384.1523991423@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rCb8EA+9TsBVtA92" Content-Disposition: inline In-Reply-To: <2384.1523991423@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --rCb8EA+9TsBVtA92 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 17, 2018 at 02:57:03PM -0400, Tom Lane wrote: > I think possibly the OP doesn't understand why it's designed that way. > The point is not really to "recycle old WAL files", it's to avoid having > disk space allocation occur during the critical section where we must > PANIC on failure. Now, of course, that doesn't really work if the > filesystem is COW underneath, because it's allocating fresh disk space > anyway even though semantically we're overwriting existing data. > But what I'd like to see is a fix that deals with that somehow, rather > than continue to accept the possibility of ENOSPC occurring inside WAL > writes on these file systems. I have no idea what such a fix would > look like :-( That looks like a rather difficult problem to solve in PostgreSQL itself, as the operator running the cluster is in charge of setting up the FS options which would control the COW behavior, so it seems to me that there is room as well for an in-core option to tell the checkpointer to enforce the removal of past files instead of simple recycling them, because this actually breaks max_wal_size. max_wal_size is of course a soft limit, and it has been discussed a couple of times that it would be nice to get that to a hard limit, but it is really a hard problem to avoid the system to not slow down or even stop its I/O if the hard is close by or reached.. -- Michael --rCb8EA+9TsBVtA92 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlrWyx8ACgkQnvQgOdby QH1XGw/+Op2DOOOoRnEHoC/Zyoa1bd8JpHVueJHwfxl/DNiJrr07ZPKOzp07FykQ jdNThvfHuqYxEGUFiKz7DxTJTZuAd4iB/I5JEIVIyKI3V3Hy9bvEI3967xnZlfIZ /tPK6LRWngiV5ZFJ5dytyvpvMPzYKaRBSDxTYzcncO2P6Y2YGBNRxLTHUG5Ht4Lh KB2/e+UIslSO1TSGJQHXzLRGrW6TdyVs9KO4aV3p3FZOAKl7SdFf467vfrBtRVVZ kmqYB+zsahhvXIRI8dGHknNYKUpH6jGn7FGTFDofYWpNDubPsY2cg9kTKUh8MAE7 x+Mjn8rv9v69SRQuCJXN+wWTU/1ZJKzP0x72spSP5Mt4ZYaRSl6JThQbFzk30OQa GVl+W33KxY96xAMAV2SlT1vYRg6L9fULtU2r3FSOkdJX9/RSpR30upiSzjrYEAZ3 4jOfG8mofRhhUYkwoI4cSbzyhw/OwTBk3Bq4a1RiFIHoufha1SE7hWwfLrCK+zRP PIO/ktAOflAaUOaETsqooW+aIGA/xqXDB40IqNPjo9IQMKexGEBjgwIFU20jkfjD 23k3zIE5a7mLQaeM64v5Cho4m91bmUuIG0/OIgzNB/cOV9r3pUK5F59Je/knJe6A egRvzgev7kFgeWm3bd/eFQlBo0V6SJ8CrAn4f50nHxF3MULG8t4= =tHYJ -----END PGP SIGNATURE----- --rCb8EA+9TsBVtA92--