Re: semaphore usage "port based"?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: semaphore usage "port based"?
Дата
Msg-id 25422.1144016604@sss.pgh.pa.us
обсуждение исходный текст
Ответ на semaphore usage "port based"?  ("Marc G. Fournier" <scrappy@postgresql.org>)
Ответы Re: semaphore usage "port based"?
Список pgsql-hackers
"Marc G. Fournier" <scrappy@postgresql.org> writes:
> Or, more simply, I think ... is there somewhere in the Semaphore code that 
> is using the port # as a 'seed'?

We use the port number as a basis for selecting the semaphore key (see
semget(2)).  There is code in there to pick a different key value if the
one we first selected appears to be in use; that has to work correctly
if you're going to run multi postmasters on the same port number.  It
sounds like FBSD 6 has done something that broke the key-in-use check.

Look at IpcSemaphoreCreate and InternalIpcSemaphoreCreate in
src/backend/port/sysv_sema.c.  It may be worth stepping through them
with gdb to see what the semget calls are returning.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_class catalog question...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: semaphore usage "port based"?