Re: time-delayed standbys - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: time-delayed standbys
Date
Msg-id BANLkTinK04O8MZ7K8U8tguT1Oc6UjGYEQw@mail.gmail.com
Whole thread Raw
In response to Re: time-delayed standbys  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: time-delayed standbys
List pgsql-hackers
On Wed, Jun 29, 2011 at 11:14 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Wed, Jun 15, 2011 at 1:58 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> After we run "pg_ctl promote", time-delayed replication should be disabled?
>> Otherwise, failover might take very long time when we set recovery_time_delay
>> to high value.
>
> PFA a patch that I believe will disable recovery_time_delay after
> promotion.  The only change from the previous version is:
>
> diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog
> index 1dbf792..41b3ae9 100644
> --- a/src/backend/access/transam/xlog.c
> +++ b/src/backend/access/transam/xlog.c
> @@ -5869,7 +5869,7 @@ pg_is_xlog_replay_paused(PG_FUNCTION_ARGS)
>  static void
>  recoveryDelay(void)
>  {
> -       while (1)
> +       while (!CheckForStandbyTrigger())
>        {
>                long    secs;
>                int             microsecs;

Thanks for updating patch! I have a few comments;

ISTM recoveryDelayUntilTime needs to be calculated also when replaying
the commit
*compact* WAL record (i.e., record_info == XLOG_XACT_COMMIT_COMPACT).

When the user uses only two-phase commit on the master, ISTM he or she cannot
use this feature. Because recoveryDelayUntilTime is never set in that
case. Is this
intentional?

We should disable this feature also after recovery reaches the stop
point (specified
in recovery_target_xxx)?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Dry Run mode for pg_archivecleanup
Next
From: Fujii Masao
Date:
Subject: Re: time-delayed standbys