Skip site navigation (1) Skip section navigation (2)

pgsql: On Windows, when a file is deleted and another process still has

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: On Windows, when a file is deleted and another process still has
Date: 2009-09-10 09:43:17
Message-ID: 20090910094317.CFD34753FB7@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
On Windows, when a file is deleted and another process still has an open
file handle on it, the file goes into "pending deletion" state where it
still shows up in directory listing, but isn't accessible otherwise. That
confuses RemoveOldXLogFiles(), making it think that the file hasn't been
archived yet, while it actually was, and it was deleted along with the .done
file.

Fix that by renaming the file with ".deleted" extension before deleting it.
Also check the return value of rename() and unlink(), so that if the removal
fails for any reason (e.g another process is holding the file locked), we
don't delete the .done file until the WAL file is really gone.

Backpatch to 8.2, which is the oldest version supported on Windows.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
    pgsql/src/backend/access/transam:
        xlog.c (r1.292.2.7 -> r1.292.2.8)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.292.2.7&r2=1.292.2.8)

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2009-09-10 09:43:32
Subject: pgsql: On Windows, when a file is deleted and another process still has
Previous:From: Heikki LinnakangasDate: 2009-09-10 09:42:29
Subject: pgsql: On Windows, when a file is deleted and another process still has

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group