Re: remove reset_shared()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: remove reset_shared()
Дата
Msg-id 3885875.1657989251@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: remove reset_shared()  (Pavel Borisov <pashkin.elfe@gmail.com>)
Ответы Re: remove reset_shared()  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
Pavel Borisov <pashkin.elfe@gmail.com> writes:
> I see the proposed patch as uncontroversial and good enough to be
> committed. It will make the code a little clearer. Personally, I don't like
> leaving functions that are just wrappers for another and called only once.

Yeah, I like this for a different reason: just a couple days ago I was
comparing the postmaster's startup sequence to that used in standalone
mode (in postgres.c) and was momentarily confused because one had
reset_shared() where the other had CreateSharedMemoryAndSemaphores().

Looking in our git history, it seems that reset_shared() used to embed
slightly more knowledge, but it sure looks pretty pointless now.

> But I think that if there's a question of code readability it's not bad to
> restore the comments on the purpose of a call that were originally in the
> code.

Actually I think you chose the wrong place to move the comment to.
It applies to the initial postmaster start, because what it's pointing
out is that we'll probably choose the same IPC keys as any previous
run did.  If we felt the need to enforce that during a crash restart,
we surely could do so directly.

Pushed after fiddling with the comments.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PSA: Autoconf has risen from the dead
Следующее
От: Nikolay Shaplov
Дата:
Сообщение: Re: The "char" type versus non-ASCII characters