Re: archive_keepalive_command

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: archive_keepalive_command
Date: 2012-03-04 01:20:01
Message-ID: CAMkU=1zqhwgu4+=+hrk6+fE8S+hBYZNfzLHhqV-P-56-ADpVGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 15, 2012 at 5:52 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Fri, Dec 16, 2011 at 3:01 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>> archive_command and restore_command describe how to ship WAL files
>> to/from an archive.
>>
>> When there is nothing to ship, we delay sending WAL files. When no WAL
>> files, the standby has no information at all.
>>
>> To provide some form of keepalive on quiet systems the
>> archive_keepalive_command provides a generic hook to implement
>> keepalives. This is implemented as a separate command to avoid storing
>> keepalive messages in the archive, or at least allow overwrites using
>> a single filename like "keepalive".

>
> Patch.

Preliminary review:

Applies with several hunks, and with some fuzz in xlog.h

Builds cleanly and passes make check.

Does not provide documentation, which is needed.

Does not include regression tests, but there is no framework for
testing archiving.

Usability testing:

Does this patch have any user-visible effect? I thought it would make
pg_last_xact_replay_timestamp() advance, but it does not seem to. I
looked through the source a bit, and as best I can tell this only sets
some internal state which is never used, except under DEBUG2

The example archive_keepalive_command given in postgresql.conf.sample
is not usable as given. If the file is named %f, then there is no
easy way for restore_keepalive_command to retrieve the file because it
would not know the name to use. So the example given in
postgresql.conf.sample should be more like the one given in
recovery.conf.sample, where it uses a hard-coded name rather than %f.
But in that case, it is not clear what %f might be useful for.

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-03-04 01:38:35 Re: Collect frequency statistics for arrays
Previous Message Alvaro Herrera 2012-03-03 23:13:04 Re: review: CHECK FUNCTION statement