Re: CreateLockFile() race condition

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: CreateLockFile() race condition
Дата
Msg-id 20120803175556.GF9683@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: CreateLockFile() race condition  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Aug 03, 2012 at 11:59:00AM -0400, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > I think we should instead implement postmaster mutual exclusion by way of
> > fcntl(F_SETLK) on Unix and CreateFile(..., FILE_SHARE_READ, ...) on Windows.
> 
> I'm a bit worried about what new problems this solution is going to open
> up.  It seems not unlikely that the cure is worse than the disease.

That's a fair concern.  There's only so much we'll know in advance.

> Having locking that actually works on (some) NFS setups would be nice,
> but ...
> 
> > The hazard[4] keeping fcntl locking from replacing the PGSharedMemoryIsInUse()
> > check does not apply here, because the postmaster itself does not run
> > arbitrary code that might reopen postmaster.pid.
> 
> False.  See shared_preload_libraries.

Quite right.  Even so, that code has a special role and narrower goals to
which it can reasonable aspire, giving credibility to ignoring the problem or
documenting the problem away.  (I don't see that we document any of the other
constraints on _PG_init of libraries named in shared_preload_libraries.)

Thanks,
nm


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: -Wformat-zero-length
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: SPGiST versus hot standby - question about conflict resolution rules