Re: file-locking and postmaster.pid

Поиск
Список
Период
Сортировка
Искать
От
korry
Тема
Re: file-locking and postmaster.pid
Дата
в 19:34:26
Msg-id
1148510070.21335.97.camel@sakai.localdomain
Ответ на
Список
Дерево обсуждения
file-locking and postmaster.pid Andreas Joseph Krogh <andreak@officenet.no>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Andreas Joseph Krogh <andreak@officenet.no>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Alvaro Herrera <alvherre@commandprompt.com>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Alvaro Herrera <alvherre@commandprompt.com>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Alvaro Herrera <alvherre@commandprompt.com>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Alvaro Herrera <alvherre@commandprompt.com>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid korry <korry@appx.com>
Re: file-locking and postmaster.pid Andreas Joseph Krogh <andreak@officenet.no>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid Andrew Dunstan <andrew@dunslane.net>
Re: file-locking and postmaster.pid Alvaro Herrera <alvherre@commandprompt.com>
Re: file-locking and postmaster.pid Alvaro Herrera <alvherre@commandprompt.com>
Re: file-locking and postmaster.pid Andrew Dunstan <andrew@dunslane.net>
Re: file-locking and postmaster.pid Alvaro Herrera <alvherre@commandprompt.com>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid Andreas Joseph Krogh <andreak@officenet.no>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid Adis Nezirovic <adis@linux.org.ba>
Re: file-locking and postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: file-locking and postmaster.pid Adis Nezirovic <adis@linux.org.ba>
Re: file-locking and postmaster.pid Andreas Joseph Krogh <andreak@officenet.no>
Re: file-locking and postmaster.pid Andreas Joseph Krogh <andreak@officenet.no>
Re: file-locking and postmaster.pid "Andrej Ricnik-Bay" <andrej.groups@gmail.com>
Re: file-locking and postmaster.pid Andreas Joseph Krogh <andreak@officenet.no>
> You never need to reduce it to a shared lock.  On postmaster startup,
> try to lock the sentinel byte (one byte past the end-of-file).  If you
> can lock it, you know that no other postmaster has that byte locked.  If
> you can't lock it, another postmaster is running. It is an atomic
> operation. 

This doesn't work if the postmaster dies but a backend continues to run,
which is arguably the most important case we need to protect against.

I may be confused here, but I don't see the problem - byte-range locks are not inherited across a fork.  A backend would never hold the lock, a backend would never even look for the lock.


> However, Tom may be correct about NFS locking, but I guess I'm surprised
> that anyone would care :-)

Quite a lot of people run NFS-mounted data directories ...

I'm happy to take your word for that, and I agree that if NFS is important and locking is brain-dead on NFS, then relying solely on a lock is unacceptable.


            -- Korry

В списке pgsql-hackers по дате отправления
От: korry
Дата:
От: Tom Lane
Дата:
FAQ