Re: Online base backup from the hot-standby

Поиск
Список
Период
Сортировка
От Steve Singer
Тема Re: Online base backup from the hot-standby
Дата
Msg-id BLU0-SMTP55C661AD49484CEECF665D8E420@phx.gbl
обсуждение исходный текст
Ответ на Re: Online base backup from the hot-standby  (Jun Ishiduka <ishizuka.jun@po.ntts.co.jp>)
Ответы Re: Online base backup from the hot-standby
Список pgsql-hackers
On 11-07-07 09:22 PM, Jun Ishiduka wrote: <blockquote cite="mid:201107080122.p681MTl2009948@ccmds32.silk.ntts.co.jp"
type="cite"><prewrap="">
 
</pre><blockquote type="cite"><pre wrap="">As you proposed, adding new field which stores the backup end location
taken from minRecoveryPoint, into pg_control sounds good idea.
</pre></blockquote><pre wrap="">
Update patch.

</pre></blockquote> Here is a review of the updated patch<br /><br /> This version of the patch adds a field into
pg_controldatathat tries to store the source of the base backup while in recovery mode. <br /> I think your ultimate
goalwith this patch is to be able to take a backup of a running hot-standby slave and recover it as another instance.  
Thispatch seems to provide the ability to have the second slave stop recovery at minRecoveryPoint from the control
file.<br/><br /><br /> My understanding of the procedure you want to get to to take base backups off a slave  is<br
/><br/> 1.  execute pg_start_backup('x') on the slave (*)<br /> 2.  take a backup of the data dir<br /> 3. call
pg_stop_backup()on the slave<br /> 4. Copy the control file  on the slave<br /><br /> This patch only addresses the
recoveryportions.<br /><br /> * - I think your goal is to be able to run pg_start_backup() on the slave, the patch so
fardoesn't do this.  If your goal was require this to be run on the master, then correct me.<br /><br /><br /> Code
Review<br/> -------------------<br /> A few comments on the code<br /><br /><blockquote type="cite">***
postgresql/src/include/catalog/pg_control.h   2011-06-30 10:04:48.000000000 +0900<br /> ---
postgresql_with_patch/src/include/catalog/pg_control.h   2011-07-07 18:23:56.000000000 +0900<br /> ***************<br
/>*** 142,147 ****<br /> --- 142,157 ----<br />       XLogRecPtr    backupStartPoint;<br />   <br />       /*<br /> +
    * Postgres keeps where to take a backup server.<br /> +      *<br /> +      * backupserver is "none" , "master" or
"slave",its default is "none".<br /> +      * When postgres starts and it is "none", it is updated to either
"master"<br/> +      * or "slave" with minRecoveryPoint of the backup server.<br /> +      * When postgres reaches
backupend location, it is updated to "none".<br /> +      */<br /> +     int            backupserver;<br /> + <br /> +
   /*<br />        * Parameter settings that determine if the WAL can be used for archival<br />        * or hot
standby.<br/>        */</blockquote><br /> I don't think the above comment is very clear on what backupserver is.<br />
Perhaps<br/><br /> /**<br />  * backupserver is used while postgresql is in recovery mode to<br />  * store the
locationof where the backup comes from.<br />  * When Postgres starts recovery operations<br />  *  it is set to
"none". During recovery it is updated to either "master", or "slave"<br />  * When recovery operations finish it is
updatedback to "none"<br />  **/<br /><br /> Also shouldn't backupServer be the enum type of 'BackupServer' not int?
Otherenums in the structure such as DBState are defined this way.<br /><br /> Testing Review<br />
----------------------<br/><br /> Since I can't yet call pg_start_backup or pg_stop_backup() on the slave I am calling
themon the master.<br /> (I also did some testing where I didn't put the system into backup mode).  I admit that I am
notsure what to look for as an indication that the system isn't recovering to the correct point.  In much of my testing
Iwas just verifying that the slave started and my data 'looked' okay.<br /><br /><br /> I seem to get this warning in
mylogs when I start up the instance based on the slave backup.<br /> LOG:  00000: database system was interrupted while
inrecovery at log time 2011-07-08 18:40:20 EDT<br /> HINT:  If this has occurred more than once some data might be
corruptedand you might need to choose an earlier recovery target<br /><br /> I'm wondering if this warning is a bit
misleadingto users because it is an expected message when starting up an instance based on a slave backup (because the
slavewas already in recovery mode).    If I shutdown this instance and start it up again I keep getting the warning. 
Myunderstanding of your patch is that there shouldn't be any risk of corruption in that case (assuming your patch has
nobugs).   Can/should we be suppressing this message when we detect that we are recovering from a slave backup?<br
/><br/><br /> The direction of the patch has changed a bit during this commit fest.   I think it would be good to
providean update on the rest of the changes you plan for this to be a complete useable feature.  That would make it
easierto comment on something you <br /> missed versus something your planning on dealing with in the next stage.<br
/><br/> Steve<br /><br /><br /><blockquote cite="mid:201107080122.p681MTl2009948@ccmds32.silk.ntts.co.jp"
type="cite"><prewrap="">Regards.
 

--------------------------------------------
Jun Ishizuka
NTT Software Corporation
TEL:045-317-7018
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:ishizuka.jun@po.ntts.co.jp">ishizuka.jun@po.ntts.co.jp</a>
--------------------------------------------
</pre> <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>

</pre></blockquote><br />

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Florian Pflug
Дата:
Сообщение: Re: Need help understanding pg_locks
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Enhanced psql in core?