On Tue, Nov 18, 2014 at 5:47 AM, Simon Riggs <si...@2ndquadrant.com> wrote: > On 21 August 2014 09:17, Julien Rouhaud <julien.rouh...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers