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

From Robert Haas
Subject Re: time-delayed standbys
Date
Msg-id BANLkTimga2ysehLSH=us9mTOWBQw1tk+8Q@mail.gmail.com
Whole thread Raw
In response to Re: time-delayed standbys  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: time-delayed standbys
List pgsql-hackers
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;

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: spinlock contention
Next
From: Steve Singer
Date:
Subject: Re: Online base backup from the hot-standby