From: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [TODO] Track number of files ready to be archived in pg_stat_archiver |
Date: | 2014-11-18 12:09:04 |
Message-ID: | CA+U5nM+NqQGQh05m53rcrDBZ-R9zO3RjMGbY1h0Fn=euXTp2Jw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 18 November 2014 06:20, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote:
> the DBA may want to know how long is the queue of WAL files
> waiting to be archived.
Agreed
> That's IMO something we simply forgot in the
> first implementation of pg_stat_archiver
That's not how it appears to me. ISTM that the information requested
is already available, it just needs some minor calculations to work
out how many files are required.
> the most direct way to
> know that is to count the .ready files in archive_status.
...my earlier point was...
>> 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.
As soon as we have sent the first file, we will know the queue length
at any point afterwards.
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2014-11-18 12:29:02 | Re: proposal: plpgsql - Assert statement |
Previous Message | Simon Riggs | 2014-11-18 11:57:47 | Re: Add shutdown_at_recovery_target option to recovery.conf |