Re: drop tablespace error: invalid argument

Поиск
Список
Период
Сортировка
От Jan Otto
Тема Re: drop tablespace error: invalid argument
Дата
Msg-id A7100E92-9E7F-438C-B4A4-17927C56D142@me.com
обсуждение исходный текст
Ответ на Re: drop tablespace error: invalid argument  (Jan Otto <asche@me.com>)
Ответы Re: drop tablespace error: invalid argument  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Jan Otto <asche@me.com> writes:
ERROR:  could not read directory "pg_tblspc/16464": Invalid argument
STATEMENT:  DROP TABLESPACE testspace;

I have digged a bit around in the source code of postgresql to build a
self contained test-case for Apple and found that the implementation
of Apples readdir() is buggy. readdir() fails under some circumstances.
So i have build a patch against current pgsql's HEAD to work around
the issue. If the bug in readdir() goes into the final release  snow leopard
we have a solution. 

This patch basically frees dirdesc and rereads the tablespace location
in case a subdirectory was deleted from the tablespace. this is the place
where snow leopard fails to read the next entry with readdir().

The bug in readdir() appeared in the final snow leopard too. Anybody
with Snow Leopard installed can check this, with simply doing the regression
tests (make check). The tablespace regression test is failing.

The patch i sent in works around the issue. if it is not acceptable to reread
the tablespace-directory after every delete i can rewrite the workaround.
Probably it is preferred that we write all entries of the directory into an array 
and looping through that array after that instead of looping with ReadDir()?

regards, jan otto 

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

Предыдущее
От: Stefan Kaltenbrunner
Дата:
Сообщение: Re: LWLock Queue Jumping
Следующее
От: Grzegorz Jaskiewicz
Дата:
Сообщение: Re: clang's static checker report.