Re: odd output in restore mode

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: odd output in restore mode
Date: 2008-05-13 05:44:35
Message-ID: 1210657475.29684.280.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Mon, 2008-05-12 at 23:03 -0400, Andrew Dunstan wrote:
> Tom Lane wrote:
> > Andrew Dunstan <andrew(at)dunslane(dot)net> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-05-13 06:07:02 Re: Fairly serious bug induced by latest guc enum changes
Previous Message Simon Riggs 2008-05-13 05:37:24 Re: odd output in restore mode

Browse pgsql-patches by date

  From Date Subject
Next Message Dave Page 2008-05-13 07:42:26 Re: odd output in restore mode
Previous Message Simon Riggs 2008-05-13 05:37:24 Re: odd output in restore mode