Re: Time-Delayed Standbys - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Re: Time-Delayed Standbys
Date
Msg-id CAFcNs+qBaBnaRJtc_1jUvDVg9DAUYN846hL+g7eWyzy_uqWkUw@mail.gmail.com
Whole thread Raw
In response to Re: Time-Delayed Standbys  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
<div dir="ltr"><div class="gmail_extra"><br />On Fri, Dec 13, 2013 at 11:44 AM, Simon Riggs <<a
href="mailto:simon@2ndquadrant.com">simon@2ndquadrant.com</a>>wrote:<br />><br />> On 13 December 2013 13:22,
AndresFreund <<a href="mailto:andres@2ndquadrant.com">andres@2ndquadrant.com</a>> wrote:<br /> > > On
2013-12-1313:09:13 +0000, Simon Riggs wrote:<br />> >> On 13 December 2013 11:58, Andres Freund <<a
href="mailto:andres@2ndquadrant.com">andres@2ndquadrant.com</a>>wrote:<br />> >> > On 2013-12-13
11:56:47+0000, Simon Riggs wrote:<br /> > >> >> On 12 December 2013 21:58, Fabrízio de Royes Mello<br
/>>>> >> <<a href="mailto:fabriziomello@gmail.com">fabriziomello@gmail.com</a>> wrote:<br />>
>>>> > Reviewing the committed patch I noted that the "CheckForStandbyTrigger()"<br /> > >>
>>> after the delay was removed.<br />> >> >> ><br />> >> >> > If we
promotethe standby during the delay and don't check the trigger<br />> >> >> > immediately after the
delay,then we will replay undesired WALs records.<br /> > >> >> ><br />> >> >> >
Theattached patch add this check.<br />> >> >><br />> >> >> I removed it because it was
afterthe pause. I'll replace it, but<br />> >> >> before the pause.<br /> > >> ><br />>
>>> Doesn't after the pause make more sense? If somebody promoted while we<br />> >> > were
waiting,we want to recognize that before rolling forward? The wait<br />> >> > can take a long while after
all?<br/> > >><br />> >> That would change the way pause currently works, which is OOS for that
patch.<br/>> ><br />> > But this feature isn't pause itself - it's imo something<br />> >
independent.Note that we currently<br /> > > a) check pause again after recoveryApplyDelay(),<br />> > b)
docheck for promotion if the sleep in recoveryApplyDelay() is<br />> >    interrupted. So not checking after the
finalsleep seems confusing.<br /> ><br />> I'm proposing the attached patch.<br />><br />> This patch
implementsa consistent view of recovery pause, which is<br />> that when paused, we don't check for promotion,
duringor immediately<br />> after. That is user noticeable behaviour and shouldn't be changed<br /> > without
thoughtand discussion on a separate thread with a clear<br />> descriptive title. (I might argue in favour of it
myself,I'm not yet<br />> decided).<br />><br /><br /></div><div class="gmail_extra">In my previous message [1] I
attacha patch equal to your ;-)<br /></div><div class="gmail_extra"><br /></div><div class="gmail_extra">Regards,<br
/></div><divclass="gmail_extra"><br />[1] <a
href="http://www.postgresql.org/message-id/CAFcNs+qD0AJ=qzhsHD9+v_Mhz0RTBJ=cJPCT_T=uT_JvvnC1FQ@mail.gmail.com">http://www.postgresql.org/message-id/CAFcNs+qD0AJ=qzhsHD9+v_Mhz0RTBJ=cJPCT_T=uT_JvvnC1FQ@mail.gmail.com</a><br
/><br/>--<br />Fabrízio de Royes Mello<br />Consultoria/Coaching PostgreSQL<br />>> Timbira: <a
href="http://www.timbira.com.br">http://www.timbira.com.br</a><br/>>> Blog sobre TI: <a
href="http://fabriziomello.blogspot.com">http://fabriziomello.blogspot.com</a><br/> >> Perfil Linkedin: <a
href="http://br.linkedin.com/in/fabriziomello">http://br.linkedin.com/in/fabriziomello</a><br/>>> Twitter: <a
href="http://twitter.com/fabriziomello">http://twitter.com/fabriziomello</a></div></div>

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Time-Delayed Standbys
Next
From: Craig Ringer
Date:
Subject: Re: WIP patch (v2) for updatable security barrier views