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

Поиск
Список
Период
Сортировка
От heikki@postgresql.org (Heikki Linnakangas)
Тема pgsql: On Windows, when a file is deleted and another process still has
Дата
Msg-id 20090910094211.166C5753FB7@cvs.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: On Windows, when a file is deleted and another process still has
Список 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.

Modified Files:
--------------
    pgsql/src/backend/access/transam:
        xlog.c (r1.351 -> r1.352)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.351&r2=1.352)

В списке pgsql-committers по дате отправления:

Предыдущее
От: petere@postgresql.org (Peter Eisentraut)
Дата:
Сообщение: pgsql: Fix/improve bytea and boolean support in PL/Python Before,
Следующее
От: heikki@postgresql.org (Heikki Linnakangas)
Дата:
Сообщение: pgsql: On Windows, when a file is deleted and another process still has