Re: BUG #2712: could not fsync segment: Permission

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Peter Brant" <Peter(dot)Brant(at)wicourts(dot)gov>
Cc: "Thomas H(dot)" <me(at)alternize(dot)com>, pgsql-bugs(at)postgresql(dot)org, Magnus Hagander <mha(at)sollentuna(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: BUG #2712: could not fsync segment: Permission
Date: 2006-10-23 17:49:14
Message-ID: 26283.1161625754@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

"Peter Brant" <Peter(dot)Brant(at)wicourts(dot)gov> writes:
> The same problem exists in 8.1 too. See this thread
> http://archives.postgresql.org/pgsql-bugs/2006-04/msg00177.php
> Tom and Magnus tracked down a cause, but I don't think a fix was ever
> implemented.

Thomas seems to have two different issues there: the "could not rename
file" problem on the pg_xlog file is probably explained by the mechanism
we identified back then (and I'm not sure why no fix has been
installed), but there is no known reason other than antivirus software
for the "could not fsync" problem.

As for fixing the problem we do understand: ISTM it's just an awful idea
for pgrename and pgunlink to be willing to loop forever. I think they
should time out and report the failure after some reasonable period
(say between 10 sec and a minute).

If we simply made that change, then the behavior when there's an idle
backend sitting on a filehandle for an old xlog segment would be that
checkpoints would fail at the MoveOfflineLogs stage, which would not
be fatal, but it'd be annoying. We'd probably want to further tweak
InstallXLogFileSegment so that rename failure isn't an ERROR, at least
not on Windows. (I think we could just make it return false, which'd
cause the caller to try to delete the xlog segment, which should work
even though rename doesn't.)

I'm not in a position to test this though. Magnus or Bruce?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas H. 2006-10-23 18:00:11 Re: BUG #2712: could not fsync segment: Permission
Previous Message Peter Brant 2006-10-23 16:42:39 Re: BUG #2712: could not fsync segment: Permission

Browse pgsql-patches by date

  From Date Subject
Next Message Thomas H. 2006-10-23 18:00:11 Re: BUG #2712: could not fsync segment: Permission
Previous Message Peter Brant 2006-10-23 16:42:39 Re: BUG #2712: could not fsync segment: Permission