Re: on_exit_reset fails to clear DSM-related exit actions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: on_exit_reset fails to clear DSM-related exit actions
Дата
Msg-id 17143.1395070356@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: on_exit_reset fails to clear DSM-related exit actions  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: on_exit_reset fails to clear DSM-related exit actions  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> One option is to just change that function to also unmap the control
> segment, and maybe rename it to dsm_detach_all(), and then use that
> everywhere.  The problem is that I'm not sure we really want to incur
> the overhead of an extra munmap() during every backend exit, just to
> get rid of a control segment which was going to be unmapped anyway by
> process termination.  For that matter, I'm not sure why we bother
> arranging that for the main shared memory segment, either: surely
> whatever function the shmdt() and munmap() calls in IpcMemoryDetach
> may have will be equally well-served by the forthcoming exit()?

Before you lobotomize that code too much, consider the postmaster
crash-recovery case.  That path does need to detach from the old
shmem segment.

Also, I might be wrong, but I think IpcMemoryDetach is a *postmaster*
on_shmem_exit routine; it isn't called during backend exit.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: First-draft release notes for next week's releases
Следующее
От: Tom Lane
Дата:
Сообщение: Re: HEAD seems to generate larger WAL regarding GIN index