archive_keepalive_command

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: archive_keepalive_command
Date: 2011-12-16 15:01:16
Message-ID: CA+U5nMKJ-av_H-yPaKOH8hJ1Smbr2aPVQWDK+U6WQBo_17uqDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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".

Examples
archive_keepalive_command = 'arch_cmd keepalive' # sends a file
called "keepalive" to archive, overwrites allowed
archive_keepalive_command = 'arch_cmd %f.%t.keepalive #sends a file
like 000000010000000AB00000000FE.20111216143517.keepalive

If there is no WAL file to send, then we send a keepalive file
instead. Keepalive is a small file that contains same contents as a
streaming keepalive message (re: other patch on that).

If no WAL file is available and we are attempting to restore in
standby_mode, then we execute restore_keepalive_command to see if a
keepalive file is available. Checks for a file in the specific
keepalive format and then uses that to update last received info from
master.

e.g.
restore_keepalive_command = 'restore_cmd keepalive' # gets a file
called "keepalive" to archive, overwrites allowed

Additions/changes?

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-12-16 15:32:39 Re: RangeVarGetRelid()
Previous Message Richard Huxton 2011-12-16 14:55:09 Escaping ":" in .pgpass - code or docs bug?