Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6A3739FB8A5 for ; Fri, 31 Aug 2007 22:45:18 -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 67167-05 for ; Fri, 31 Aug 2007 22:45:15 -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 455579FB887 for ; Fri, 31 Aug 2007 22:45:15 -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 l811jAqH005803; Fri, 31 Aug 2007 21:45:10 -0400 (EDT) To: Jeff Frost cc: pgsql-admin@postgresql.org Subject: Re: pitr replica dies on startup In-reply-to: References: <3673.1188602373@sss.pgh.pa.us> Comments: In-reply-to Jeff Frost message dated "Fri, 31 Aug 2007 18:24:08 -0700" Date: Fri, 31 Aug 2007 21:45:10 -0400 Message-ID: <5802.1188611110@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/427 X-Sequence-Number: 26758 Jeff Frost writes: > Why does it request it twice? I think the reason is that the rollforward cycle is fetch next segment into RECOVERYXLOG process segment unlink RECOVERYXLOG and only when the "fetch" step fails does it realize it's done. So then it has to figure out which segment it wants to start extending and fetch that into the real name of the segment. We could probably rejigger this to avoid a duplicate fetch in common cases, but I'm worried that we couldn't guarantee it in every case --- edge cases like the last valid xlog record ending right at a segment boundary might be trouble. If the recovery script has to handle the situation sometimes, it's probably best to make it do so on a regular basis --- would you like to have only found out about this when you were trying to revive your database at 4AM? regards, tom lane