pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jaime Casanova <jaime@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: time-delayed standbys
Date: Wed, 11 May 2011 12:27:02 +0300
Message-ID: <4DCA5666.50506@enterprisedb.com> (raw)
In-Reply-To: <BANLkTinfrgsVK_8o9+mw6kWRcC4BxiR4jw@mail.gmail.com>
References: <BANLkTi==TTzHDqWzwJDjmOf__8YuA7L1jw@mail.gmail.com>
	<BANLkTikHcD8H=iS=xZCTnyNAYMbDu3Tj1Q@mail.gmail.com>
	<BANLkTinfrgsVK_8o9+mw6kWRcC4BxiR4jw@mail.gmail.com>

On 07.05.2011 16:48, Robert Haas wrote:
> I was able to reproduce something very like this in unpatched master,
> just by letting recovery pause at a named restore point, and then
> resuming it.
>
> LOG:  recovery stopping at restore point "stop", time 2011-05-07
> 09:28:01.652958-04
> LOG:  recovery has paused
> HINT:  Execute pg_xlog_replay_resume() to continue.
> (at this point I did pg_xlog_replay_resume())
> LOG:  redo done at 0/5000020
> PANIC:  wal receiver still active
> LOG:  startup process (PID 38762) was terminated by signal 6: Abort trap
> LOG:  terminating any other active server processes
>
> I'm thinking that this code is wrong:
>
>                      if (recoveryPauseAtTarget&&  standbyState ==
> STANDBY_SNAPSHOT_READY)
>                      {
>                          SetRecoveryPause(true);
>                          recoveryPausesHere();
>                      }
>                      reachedStopPoint = true;    /* see below */
>                      recoveryContinue = false;
>
> I think that recoveryContinue = false assignment should not happen if
> we decide to pause.  That is, we should say if (recoveryPauseAtTarget
> &&  standbyState == STANDBY_SNAPSHOT_READY) { same as now } else
> recoveryContinue = false.

No, recovery stops at that point whether or not you pause. Resuming 
after stopping at the recovery target doesn't mean that you resume 
recovery, it means that you resume to end recovery and start up the 
server (see the 2nd to last paragraph at 
http://www.postgresql.org/docs/9.1/static/recovery-target-settings.html). It 
would probably be more useful to allow a new stopping target to be set 
and continue recovery, but the current pause/resume functions don't 
allow that.

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



view thread (114+ messages)  latest in thread

Message-ID: <4DCA5666.50506@enterprisedb.com>
Permalink:  ../4DCA5666.50506@enterprisedb.com/
Also on:    postgresql.org/message-id/4DCA5666.50506@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, robertmhaas@gmail.com, jaime@2ndquadrant.com
  Subject: Re: time-delayed standbys
  In-Reply-To: <4DCA5666.50506@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox