From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Gabriele Bartolini <gabriele(dot)bartolini(at)2ndquadrant(dot)it> |
Cc: | Fabrizio Mello <fabriziomello(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCH] Support for pg_stat_archiver view |
Date: | 2014-01-07 08:33:32 |
Message-ID: | CAB7nPqTSfJxD48QNTNdGQ9QN2VQcBKb5U30ez1VE89dXRXv8+A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jan 6, 2014 at 5:37 PM, Gabriele Bartolini
<gabriele(dot)bartolini(at)2ndquadrant(dot)it> wrote:
> Hi Fabrizio,
>
> Il 05/01/14 20:46, Fabrizio Mello ha scritto:
>> I don't see your code yet, but I would like to know if is possible to
>> implement this view as an extension.
> I wanted to do it as an extension - so that I could backport that to
> previous versions of Postgres.
>
> I do not think it is a possibility, given that the client code that is
> aware of the events lies in pgarch.c.
I don't see particularly any point in doing that as an extension as
you want to log this statistical information once archive has either
failed or passed.
I just had a quick look at v2, and it looks that the patch is in good
shape. Sorry to be picky, but I am not sure that using the character
m_type is adapted when delivering messages to pgstat facility. You
might want to use a boolean instead... MAX_XFN_CHARS is not adapted as
well IMO: you should remove it and use instead MAXFNAMELEN of
xlog_internal.h, where all the file names related to WAL files,
including history and backup files, are generated.
Then, the patch looks to be working as expected, here are some results
with a short test:
=# \x
Expanded display (expanded) is on.
=# select * from pg_stat_get_archiver();
-[ RECORD 1 ]----------+------------------------------
archived_wals | 6
last_archived_wal | 000000010000000000000005
last_archived_wal_time | 2014-01-07 17:27:34.752903+09
failed_attempts | 12
last_failed_wal | 000000010000000000000006
last_failed_wal_time | 2014-01-07 17:31:18.409528+09
stats_reset
(1 row)
=# select * from pg_stat_archiver;
-[ RECORD 1 ]----------+------------------------------
archived_wals | 6
last_archived_wal | 000000010000000000000005
last_archived_wal_time | 2014-01-07 17:27:34.752903+09
failed_attempts | 12
last_failed_wal | 000000010000000000000006
last_failed_wal_time | 2014-01-07 17:31:18.409528+09
stats_reset | 2014-01-07 17:25:51.949498+09
Regards,
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2014-01-07 08:37:52 | Re: Fixing pg_basebackup with tablespaces found in $PGDATA |
Previous Message | Michael Paquier | 2014-01-07 08:05:03 | Re: [bug fix] "pg_ctl stop" times out when it should respond quickly |