Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cW1MP-0001xy-Rm for pgsql-admin@arkaria.postgresql.org; Tue, 24 Jan 2017 13:42:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cW1MP-0000yD-75 for pgsql-admin@arkaria.postgresql.org; Tue, 24 Jan 2017 13:42:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cW1MO-0000xw-KK for pgsql-admin@postgresql.org; Tue, 24 Jan 2017 13:42:08 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cW1MM-0008R2-6d for pgsql-admin@postgresql.org; Tue, 24 Jan 2017 13:42:07 +0000 Received: from Davids-iMac.local (c-73-55-5-246.hsd1.fl.comcast.net [73.55.5.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id BE8FF556D8; Tue, 24 Jan 2017 13:42:05 +0000 (UTC) Subject: Re: Strange times in WAL files in archive directory (9.3) To: Achilleas Mantzios References: <58871A66.306@matrix.gatewaynet.com> <58873609.4030004@matrix.gatewaynet.com> <13126.1485264550@sss.pgh.pa.us> Cc: pgsql-admin@postgresql.org From: David Steele Message-ID: Date: Tue, 24 Jan 2017 08:42:05 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <13126.1485264550@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) 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 Hi Achilleas, On 1/24/17 8:29 AM, Tom Lane wrote: > Achilleas Mantzios writes: > >> 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 >= 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. Agreed, that should work. However, this just the beginning of the complexities you will encounter when dealing with WAL archiving and expiration. You should consider using a mature third-party solution like pgBackRest or Barman. -- -David david@pgmasters.net -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin