Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 286129FB895 for ; Thu, 11 Oct 2007 11:23:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75772-03 for ; Thu, 11 Oct 2007 11:22:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 03E6A9FB8B4 for ; Thu, 11 Oct 2007 11:22:54 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l9BEMnRU013020; Thu, 11 Oct 2007 10:22:49 -0400 (EDT) To: Thomas Karcher cc: pgsql-admin@postgresql.org Subject: Re: Consistent PITR backup In-reply-to: <20071011093908.GA7988@arche.mine.nu> References: <20071011093908.GA7988@arche.mine.nu> Comments: In-reply-to Thomas Karcher message dated "Thu, 11 Oct 2007 11:39:09 +0200" Date: Thu, 11 Oct 2007 10:22:49 -0400 Message-ID: <13019.1192112569@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/90 X-Sequence-Number: 27004 Thomas Karcher writes: > My idea is now: When doing a consistent PITR backup, extend the > documented steps between 4 (pg_stop_backup()) and 5 (wait for archived > WAL file) with a busy wait on pg_xlog/archive_status/*.ready files - as > soon as no .ready files are there anymore, the archiver has done its > work, and I can safely backup the archived WAL files in order to have a > really consistent backup. If the database is busy, you might never see an instant where there are no .ready files. Certainly it's possible that this approach will archive many more segments than you need. > Is that right? Or is there an easier way to do it? I believe the intended way to do this is to look at pg_stop_backup's return value to determine the last segment you need to archive. regards, tom lane