CREATE DATABASE vs delayed table unlink

Поиск
Список
Период
Сортировка
От Tom Lane
Тема CREATE DATABASE vs delayed table unlink
Дата
Msg-id 10977.1223482135@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: CREATE DATABASE vs delayed table unlink  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
The thread here
http://archives.postgresql.org/pgsql-performance/2008-10/msg00031.php
illustrates an undesirable side effect of the recent patch to delay
table file unlinks to the next checkpoint.  What is evidently happening
is that copydir() fetches a block of a directory, and by the time it
arrives at some particular entry in the block, a checkpoint has happened
and that file got removed.  If there are some large files in the
directory then the window for this race condition can be wide.

The only real solution I can see is to replace createdb()'s
FlushDatabaseBuffers call with a full-blown checkpoint.  It's pretty
annoying to do *two* checkpoints in a CREATE DATABASE, but as long as
we're doing this via filesystem-based APIs we probably haven't got much
choice.

Comments?
        regards, tom lane


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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: autovacuum and reloptions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: autovacuum and reloptions