<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">You only need WAL files from your last backup. I backup my 8.4 database daily and just depending on the database usage on how many WAL files are created in
 a day. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Wolf<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> pgpool-general-bounces@pgpool.net [mailto:pgpool-general-bounces@pgpool.net]
<b>On Behalf Of </b>Daniele Di Vito<br>
<b>Sent:</b> Tuesday, April 09, 2013 11:56 AM<br>
<b>To:</b> pgpool-general@pgpool.net<br>
<b>Subject:</b> [pgpool-general: 1586] WAL files for online recovery.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<o:p></o:p></p>
</div>
<p class="MsoNormal">I'm using pgpool-II 3.2.3 in recovery mode with 2 backend node cause my aim is to have a real-time replication of the primary database (bldlam server in the example is the primary and devlam0 is the backup server).<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I do not use the streaming replication mode cause I'm using the 8.3 postgresql version.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Pgpool is working fine and i tested many times the online recovery using a few WAL files (10-15) and all seems to be working fine but I have a doubt and I would like to avoid any trouble in future.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Anyone knows if there is a way to know how many WAL files are needed to complete an online recovery after a node failover?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I ask it cause the performances of the server I use are really limited and if it's possible I would prefer not to archive all the wall files.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
I suppose that WAL files created after &quot;select pg_start_backup('pgpool-recovery');&quot; can be enough<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">this is what my 1st and 2nd stage commands do:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">1st stage<br>
<br>
#! /bin/sh<br>
##let's begin recovery mode<br>
/usr/local/pgsql-test/bin/psql -p 5445 -c &quot;select pg_start_backup('pgpool-recovery');&quot; postgres<br>
#let's set the restore command<br>
echo &quot;restore_command = 'cp /home/postgres/exchange_bldlam/wal/%f %p'&quot; &gt; /usr/local/pgsql-test/data/recovery.conf<br>
echo &quot;compressing base folder&quot;<br>
#tar -C /usr/local/pgsql-test/data -zcf pgsql.tar.gz base global pg_clog pg_multixact pg_subtrans pg_tblspc pg_twophase pg_xlog recovery.conf<br>
tar -cvf pgsql.tar.gz -C /usr/local/pgsql-test/data base global pg_clog pg_multixact pg_subtrans pg_tblspc pg_twophase pg_xlog recovery.conf<br>
echo &quot;stopping backup mode&quot;<br>
/usr/local/pgsql-test/bin/psql -p 5445 -c &quot;select pg_stop_backup();&quot; postgres<br>
echo &quot;sending base data to devlam0&quot;<br>
scp pgsql.tar.gz devlam0:/usr/local/bldlam/pgsql/data<br>
<br>
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">2nd stage <br>
<br>
echo &quot;executing pg_switch_xlog&quot;<br>
/usr/local/pgsql-test/bin/psql -p 5445 -c &quot;SELECT pg_switch_xlog();&quot; postgres<br>
echo &quot;compressing wal files to send&quot;<br>
cd&nbsp; /usr/local/pgsql-test/archive_wal <br>
tar -cvf wal.tar.gz -C /usr/local/pgsql-test/archive_wal *<br>
#inviamoli all'atro server pnella cartella di exchange<br>
echo &quot;sending wal archive to devlam0&quot;<br>
rsync /usr/local/pgsql-test/archive_wal/wal.tar.gz <a href="mailto:postgres@devlam0:/home/postgres/exchange_bldlam/wal/wal.tar.gz">
postgres@devlam0:/home/postgres/exchange_bldlam/wal/wal.tar.gz</a> &lt;/dev/null<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks in advance<br>
<br>
--<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Daniele Di Vito<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>