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 1gK2oH-0005V0-QN for pgsql-admin@arkaria.postgresql.org; Tue, 06 Nov 2018 14:58:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gK2oG-0002p5-2i for pgsql-admin@arkaria.postgresql.org; Tue, 06 Nov 2018 14:58:28 +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 1gK2oF-0002oy-R2 for pgsql-admin@lists.postgresql.org; Tue, 06 Nov 2018 14:58:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK2oD-0000Cb-RA for pgsql-admin@lists.postgresql.org; Tue, 06 Nov 2018 14:58:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wA6EwNLC023170; Tue, 6 Nov 2018 09:58:23 -0500 From: Tom Lane To: Achilleas Mantzios cc: pgsql-admin@lists.postgresql.org Subject: Re: PostgreSQL 10.5 : Strange pg_wal fill-up, solved with the shutdown checkpoint In-reply-to: <6031b670-52d1-b823-6b41-35d2fa1873c6@matrix.gatewaynet.com> References: <0d25bb8c-9cc7-10bc-71ba-6a8a8c33ec49@matrix.gatewaynet.com> <46D70340-2172-406A-A346-B2D4C6E947E4@crazybean.net> <6031b670-52d1-b823-6b41-35d2fa1873c6@matrix.gatewaynet.com> Comments: In-reply-to Achilleas Mantzios message dated "Tue, 06 Nov 2018 10:37:37 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23168.1541516303.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 06 Nov 2018 09:58:23 -0500 Message-ID: <23169.1541516303@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Achilleas Mantzios writes: > Remember : postgresql checkpointer decided to remove 5000+ files before = shutdown. If any conditions were keeping those files afloat should also ho= ld at this point, right. > The question is why didn't Postgresql removed them earlier. WAL files get removed/recycled after completion of a checkpoint. So apparently, checkpoints were not finishing during normal operation, but the shutdown checkpoint managed to terminate normally. That eliminates a lot of the usual theories about why checkpoints might not be succeeding (like a dirty buffer that always fails to be written, say as a result of broken permissions on its file). The only theory that comes to mind is that the checkpointer process was stuck somehow, but just "soft" stuck, in a way that allowed the postmaster's time-to-shut-down-please signal to unstick it. No, I have no idea how that could happen exactly. If it happens again, it'd be really interesting to attach to the checkpointer with a debugger and collect a stack trace. regards, tom lane