Re: [GENERAL] Logging the fact that a log was shipped - Mailing list pgsql-general

From Stephen Frost
Subject Re: [GENERAL] Logging the fact that a log was shipped
Date
Msg-id 20170828132244.GP4628@tamriel.snowman.net
Whole thread Raw
In response to Re: [GENERAL] Logging the fact that a log was shipped  (Christoph Moench-Tegeder <cmt@burggraben.net>)
Responses Re: [GENERAL] Logging the fact that a log was shipped  (Christoph Moench-Tegeder <cmt@burggraben.net>)
List pgsql-general
* Christoph Moench-Tegeder (cmt@burggraben.net) wrote:
> ## Ron Johnson (ron.l.johnson@cox.net):
>
> > How is this done in v8.4?  (I tried adding "date; rsync ..." but pg
> > didn't like that *at all*.)
>
> There's a DEBUG1-level log message on successful archive_command
> completion - that would give you a lot of other low-prio log
> messages wich you probably don't care about.
> I'd put a wrapper around your rsync (a short shell script
> would be sufficient) in the lines of rsync ... && logger "done",
> that way you'd get the information via syslog.
> On the other hand, do you really need the details about each WAL
> segment? Since 9.4 there's pg_stat_wal_archiver... You're really
> making your job harder than it needs to be with that ancient
> PostgreSQL...

Worse, such scripts run the serious risk of losing WAL if a crash
happens because nothing is ensuring that the WAL has been sync'd to disk
before returning from the archive_command.

Most of the existing tools for dealing with WAL archival (pgbackrest,
barman and WAL-E, at least) already log successful and unsuccessful
archive command runs.  I'm pretty sure barman supports back to 8.4 and I
know pgbackrest does.

Thanks!

Stephen

Attachment

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: [GENERAL] Logging the fact that a log was shipped
Next
From: Dave Cramer
Date:
Subject: Re: [GENERAL] jdbc driver vis Release 10