Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id AA0B22E0121 for ; Tue, 13 May 2008 02:43:48 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06723-07 for ; Tue, 13 May 2008 02:43:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail136041.authsmtp.com (outmail136041.authsmtp.com [62.13.136.41]) by developer.postgresql.org (Postfix) with ESMTP id 2999C2E011E for ; Tue, 13 May 2008 02:43:05 -0300 (ADT) Received: from mail-c188.authsmtp.com (mail-c188.authsmtp.com [62.13.128.25]) by punt3.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id m4D5h1h2069606; Tue, 13 May 2008 06:43:01 +0100 (BST) Received: from [192.168.0.3] (85-211-14-22.dyn.gotadsl.co.uk [85.211.14.22]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m4D5gxGr034328; Tue, 13 May 2008 06:42:59 +0100 (BST) Subject: Re: odd output in restore mode From: Simon Riggs To: Andrew Dunstan Cc: Tom Lane , PostgreSQL-development In-Reply-To: <482904FD.4030006@dunslane.net> References: <4828AF1D.7060405@dunslane.net> <1210630440.29684.249.camel@ebony.site> <4828CB9D.7070102@dunslane.net> <1210635473.29684.268.camel@ebony.site> <4828EBCB.6010004@dunslane.net> <6489.1210642738@sss.pgh.pa.us> <482904FD.4030006@dunslane.net> Content-Type: text/plain Date: Tue, 13 May 2008 06:44:35 +0100 Message-Id: <1210657475.29684.280.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Server-Quench: 723c89cb-20af-11dd-aecc-001871e930f4 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaQZbYFhI HGQLW1xEUFt7XWF/ bgMfZQBDYEtPQQRu TkpLXVBXCwUmXBh1 A0lWJVtydAFFenY+ Z0dmXz5cXkcpfU8u EFNWFTxQeGZhPDQC ARULJB5UcAJCeR4Q Y1N/AndDAzANdhEY NiQQEgoKCH1YJCgd RRwRNU8OCUcNViQx XAwFBzhnGEoJSk0g X-Authentic-SMTP: 61633235383639.cat.dmpriest.net.uk:953/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/398 X-Sequence-Number: 118397 On Mon, 2008-05-12 at 23:03 -0400, Andrew Dunstan wrote: > Tom Lane wrote: > > Andrew Dunstan writes: > >> Simon Riggs wrote: > >> > >>> Well, the patch was rejected long ago, not sure why its in this > >>> commitfest. But its an open issue on the Windows port. > >>> > > > >> Surely the right fix is to use the recently implemented > >> pgwin32_safestat() (if we aren't already - I suspect we probably are) > >> and remove the kluge in pg_standby.c. > >> > > > > I think the open issue is how to know whether pgwin32_safestat fixes the > > problem that the kluge tried to work around. > > > Well, I think we need to consider quite a number of scenarios. The > archive directory could be local, on a remote Windows machine, or on a > remote Samba server. The archive file could be copied by Windows copy, > or Unix cp, or scp, or rsync, among others. > > I'd like to know the setup that was found to produce the error, to start > with. It's a race condition, not a deterministic bug with recreatable conditions. My understanding is the current code was introduced to work around the implementation of stat on Windows which says the filesize is correct even while it is still copying it. The 1sec delay fixed that but is clearly not a foolproof fix and introduces a delay also, which was the original complaint. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com