Re: Patch to add a feature to pg_standby - Mailing list pgsql-patches

From Heikki Linnakangas
Subject Re: Patch to add a feature to pg_standby
Date
Msg-id 48184A14.2080005@enterprisedb.com
Whole thread Raw
In response to Patch to add a feature to pg_standby  (chris.johnson@desknetinc.com)
Responses Re: Patch to add a feature to pg_standby
List pgsql-patches
chris.johnson@desknetinc.com wrote:
> When using pg_standby to remain in recovery mode on a warm standby system,
> if there is a need to perform other actions in coordination with recovery
> actions, the -x <auxiliary command> option implemented by this patch
> enables that coordination.  I considered adding the ability to override the
> restoreCommand, however by keeping this separate and optional it is
> possible to force retries of the auxiliary command until successful and
> still utilize pg_usleep instead of looping within an external script or
> command.  And the previous behavior of pg_standby remains unchanged (other
> than debug logging and documenting the option in usage) if the new option
> is omitted.
>
> I added this feature to help with synchronization of a content repository
> consisting of a PostgreSQL db for meta-information and a separate file
> store for content.
> The auxiliary command enables forcing an rsync of the file store that is at
> least as current as the found WAL segment file's db changes, and prevents
> recovery of that WAL file unless the rsync can be performed successfully.
>
> (See attached file: pg_standby.c.diff)

This could be implemented by a "pass-through" restore_command, that
calls pg_standby, and does the custom action when pg_standby returns
successfully. Or perhaps you could run the custom action in whatever
script is copying the files to the directory.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-patches by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: pg_postmaster_reload_time() patch
Next
From: Simon Riggs
Date:
Subject: Re: Patch to add a feature to pg_standby