Re: create tablespace fails silently, or succeeds improperly

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: create tablespace fails silently, or succeeds improperly
Дата
Msg-id 17931.1292091659@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: create tablespace fails silently, or succeeds improperly  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: create tablespace fails silently, or succeeds improperly  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Sat, Dec 11, 2010 at 10:56 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> OK. �Is there any value in doing mkdir -p in WAL-recovery execution of
>> CREATE TABLESPACE but not regular execution?

> I don't think so.  If someone creates a directory that is not fsync'd,
> and then creates a subdirectory and puts a tablespace on it, and then
> crashes after this has been WAL-logged but before the directory
> entries have hit the disk, well, unlucky for them, but that's a
> vanishingly rare situation.

I'm not really thinking about crash recovery, but replication slaves.
Omitting to create the tablespace location directories on slaves
doesn't seem far-fetched at all.  Of course, it's likely that
the slave server will lack permissions to create in the location
directory's parent; but if it can, the outcome shouldn't be too
unreasonable.

> There's no guarantee that we'd set
> properties on the parent directory that would match the user's
> expectation anyway, especially if SE-Linux or something is involved.

If SELinux doesn't like it, it's going to fail no matter what we do.
I'm just suggesting that trying to create the directory path will fail
in fewer cases than not trying.
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: create tablespace fails silently, or succeeds improperly
Следующее
От: Robert Haas
Дата:
Сообщение: Re: create tablespace fails silently, or succeeds improperly