<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I&#39;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).<br>
</div>I do not use the streaming replication mode cause I&#39;m using the 8.3 postgresql version.<br><br></div>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.<br>
<br></div><div>Anyone knows if there is a way to know how many WAL files are needed to complete an online recovery after a node failover?<br></div><div><br></div><div>I ask it cause the performances of the server I use are really limited and if it&#39;s possible I would prefer not to archive all the wall files.<br>
</div><div><br>I suppose that WAL files created after &quot;select pg_start_backup(&#39;pgpool-recovery&#39;);&quot; can be enough<br></div><div><br></div><div>this is what my 1st  and 2nd stage commands do:<br><br></div>
<div>1st stage<br><br>#! /bin/sh<br>##let&#39;s begin recovery mode<br>/usr/local/pgsql-test/bin/psql -p 5445 -c &quot;select pg_start_backup(&#39;pgpool-recovery&#39;);&quot; postgres<br>#let&#39;s set the restore command<br>
echo &quot;restore_command = &#39;cp /home/postgres/exchange_bldlam/wal/%f %p&#39;&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><br></div><div>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  /usr/local/pgsql-test/archive_wal <br>tar -cvf wal.tar.gz -C /usr/local/pgsql-test/archive_wal *<br>#inviamoli all&#39;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 postgres@devlam0:/home/postgres/exchange_bldlam/wal/wal.tar.gz &lt;/dev/null<br></div><div><br><br></div><div><br></div><div>Thanks in advance<br><br>--<br></div><div>Daniele Di Vito<br>
</div></div>