Re: remove reset_shared() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: remove reset_shared()
Date
Msg-id 3885875.1657989251@sss.pgh.pa.us
Whole thread Raw
In response to Re: remove reset_shared()  (Pavel Borisov <pashkin.elfe@gmail.com>)
Responses Re: remove reset_shared()
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: PSA: Autoconf has risen from the dead
Next
From: Nikolay Shaplov
Date:
Subject: Re: The "char" type versus non-ASCII characters