Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cW1Bn-0001PW-JA for pgsql-admin@arkaria.postgresql.org; Tue, 24 Jan 2017 13:31:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cW1Bn-0005ju-6A for pgsql-admin@arkaria.postgresql.org; Tue, 24 Jan 2017 13:31:11 +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.84_2) (envelope-from ) id 1cW1A4-00038I-TP for pgsql-admin@postgresql.org; Tue, 24 Jan 2017 13:29:24 +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.84_2) (envelope-from ) id 1cW1A1-0001Fy-RE for pgsql-admin@postgresql.org; Tue, 24 Jan 2017 13:29:24 +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 v0ODTADu013127; Tue, 24 Jan 2017 08:29:11 -0500 From: Tom Lane To: Achilleas Mantzios cc: pgsql-admin@postgresql.org Subject: Re: Strange times in WAL files in archive directory (9.3) In-reply-to: <58873609.4030004@matrix.gatewaynet.com> References: <58871A66.306@matrix.gatewaynet.com> <58873609.4030004@matrix.gatewaynet.com> Comments: In-reply-to Achilleas Mantzios message dated "Tue, 24 Jan 2017 13:10:01 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13125.1485264550.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 24 Jan 2017 08:29:10 -0500 Message-ID: <13126.1485264550@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Achilleas Mantzios writes: > 1) Do you find this behavior normal? It's normal operation. Once a WAL file is not needed anymore, it's typically renamed into place to be a future WAL file; that's cheaper than deleting the file and creating/filling a new one. So those ones that have older timestamps do not contain useful data right this instant, but they're ready to accept data once the write pointer advances to them. > 2) From now on, can we assume a monotonic relation between file names and= creation times in order to base our maintenance scripts on this? I wouldn't. You risk deleting a file just as it starts to be used. You could possibly look into pg_control to see the current LSN and avoid touching any files >=3D that point, but of course this complicates the maintenance logic quite a bit. The larger issue here is that you're confusing the function of an archive area with that of the active WAL directory. The server will prune what is in the active WAL directory and does not want your help. In an archive directory, I'd expect the files to have monotonic timestamps corresponding to the times you copied them over to the archive, so you could rely on the timestamp sequence there. regards, tom lane --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin