Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E9F54633BCD for ; Thu, 11 Feb 2010 13:08:04 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 77783-02-2 for ; Thu, 11 Feb 2010 17:07:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og106.obsmtp.com (exprod7og106.obsmtp.com [64.18.2.165]) by mail.postgresql.org (Postfix) with SMTP id 3A31E63280E for ; Thu, 11 Feb 2010 13:04:47 -0400 (AST) Received: from source ([72.14.220.159]) by exprod7ob106.postini.com ([64.18.6.12]) with SMTP ID DSNKS3Q4rfl+p8/J1AiSWw7CM7S+XdVsa5bF@postini.com; Thu, 11 Feb 2010 09:04:47 PST Received: by fg-out-1718.google.com with SMTP id 19so103625fgg.15 for ; Thu, 11 Feb 2010 09:04:45 -0800 (PST) Received: by 10.216.86.65 with SMTP id v43mr71713wee.118.1265907885141; Thu, 11 Feb 2010 09:04:45 -0800 (PST) Received: from ?192.168.1.117? ([88.195.103.165]) by mx.google.com with ESMTPS id 5sm13454154eyf.0.2010.02.11.09.04.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Feb 2010 09:04:43 -0800 (PST) Message-ID: <4B7438A9.8090902@enterprisedb.com> Date: Thu, 11 Feb 2010 19:04:41 +0200 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Aidan Van Dyk CC: Simon Riggs , Fujii Masao , PostgreSQL-development Subject: Re: Re: [COMMITTERS] pgsql: Make standby server continuously retry restoring the next WAL References: <3f0b79eb1002092105r21e009d3v468496058ba04392@mail.gmail.com> <4B726120.80007@enterprisedb.com> <1265884657.7341.1192.camel@ebony> <4B73F678.8070109@enterprisedb.com> <1265891248.7341.1346.camel@ebony> <4B73FB99.4080403@enterprisedb.com> <1265893599.7341.1454.camel@ebony> <4B740613.5090004@enterprisedb.com> <20100211140118.GB14128@oak.highrise.ca> <4B74118C.30704@enterprisedb.com> <20100211144204.GC14128@oak.highrise.ca> In-Reply-To: <20100211144204.GC14128@oak.highrise.ca> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.398 tagged_above=-10 required=5 tests=AWL=0.201, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/896 X-Sequence-Number: 157239 Aidan Van Dyk wrote: > * Heikki Linnakangas [100211 09:17]: > >> If the file is just being copied to the archive when restore_command >> ('cp', say) is launched, it will copy a half file. That's not a problem >> for PITR, because PITR will end at the end of valid WAL anyway, but >> returning a half WAL file in standby mode is a problem. > > But it can be a problem - without the last WAL (or at least enough of > it) the master switched and archived, you have no guarantee of having > being consistent again (I'm thinking specifically of recovering from a > fresh backup) You have to wait for the last WAL file required by the backup to be archived before starting recovery. Otherwise there's no guarantee anyway. >> We could well just document that you should do that, ie. make sure the >> file appears in the archive atomically with the right size. > > I have to admit, today was the first time I went and re-read the PITR > docs, and no, the docs don't seem to talk about that... Maybe it was > just plain obvious to me because it (the atomic apperance) is something > unix devloppers have always had to deal with, so it's ingrained in me. > But I'm *sure* that I've seen that bandied around as common knowledge on > the lists, and one of the reasons we alway see warnings about using > rsync instead of plain SCP, etc. > > So ya, we should probably mention that somewhere in the docs. Section > 24.3.6. Caveats? -1. it isn't necessary for PITR. It's a new requirement for standby_mode='on', unless we add the file size check into the backend. I think we should add the file size check to the backend instead and save admins the headache. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com