Re: [TODO] Track number of files ready to be archived in pg_stat_archiver - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [TODO] Track number of files ready to be archived in pg_stat_archiver
Date
Msg-id CAB7nPqQ+ERa1dpjwqJA4cve6rKS1228xoQvHzaYtT-sCwNVv1w@mail.gmail.com
Whole thread Raw
In response to Re: [TODO] Track number of files ready to be archived in pg_stat_archiver  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: [TODO] Track number of files ready to be archived in pg_stat_archiver  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On Tue, Nov 18, 2014 at 5:47 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On 21 August 2014 09:17, Julien Rouhaud <julien.rouhaud@dalibo.com> wrote:
>
>> Track number of WAL files ready to be archived in pg_stat_archiver
>
> Would it be OK to ask what the purpose of this TODO item is?
>
> pg_stat_archiver already has a column for last_archived_wal and
> last_failed_wal, so you can already work out how many files there must
> be between then and now. Perhaps that can be added directly to the
> view, to assist the user in calculating it. Reading the directory
> itself to count the file is unnecessary, except as a diagnostic.
Not sure if this holds true in a node freshly started from a base
backup with a set of WAL files, or with files manually copied by an
operator.

> Please don't take "it is a TODO item" as "generally accepeted that
> this makes sense".
On systems where the WAL archiving is slower than WAL generation at
peak time, the DBA may want to know how long is the queue of WAL files
waiting to be archived. That's IMO something we simply forgot in the
first implementation of pg_stat_archiver, and the most direct way to
know that is to count the .ready files in archive_status.
-- 
Michael



pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: using custom scan nodes to prototype parallel sequential scan
Next
From: Michael Paquier
Date:
Subject: Re: [TODO] Track number of files ready to be archived in pg_stat_archiver