Re: Posix Shared Mem patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Posix Shared Mem patch
Дата
Msg-id 14655.1340749249@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Posix Shared Mem patch  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Posix Shared Mem patch  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Posix Shared Mem patch  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> So, what about keeping a FIFO in the data directory?

Hm, does that work if the data directory is on NFS?  Or some other weird
not-really-Unix file system?

> When the
> postmaster starts up, it tries to open the file with O_NONBLOCK |
> O_WRONLY (or O_NDELAY | O_WRONLY, if the platform has O_NDELAY rather
> than O_NONBLOCK).  If that succeeds, it bails out.  If it fails with
> anything other than ENXIO, it bails out.  If it fails with exactly
> ENXIO, then it opens the pipe with O_RDONLY

... race condition here ...

> and arranges to pass the
> file descriptor down to all of its children, so that a subsequent open
> will fail if it or any of its children are still alive.

This might be made to work, but that doesn't sound quite right in
detail.

I remember we speculated about using an fcntl lock on some file in the
data directory, but that fails because child processes don't inherit
fcntl locks.

In the modern world, it'd be really a step forward if the lock mechanism
worked on shared storage, ie a data directory on NFS or similar could be
locked against all comers not just those on the same node as the
original postmaster.  I don't know how to do that though.

In the meantime, insisting that we solve this problem before we do
anything is a good recipe for ensuring that nothing happens, just
like it hasn't happened for the last half dozen years.  (I see Alvaro
just made the same point.)
        regards, tom lane


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Posix Shared Mem patch
Следующее
От: "A.M."
Дата:
Сообщение: Re: Posix Shared Mem patch