Re: Accommodate startup process in a separate ProcState array slot instead of in MaxBackends slots.

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Accommodate startup process in a separate ProcState array slot instead of in MaxBackends slots.
Date: 2022-03-26 05:44:43
Message-ID: CALj2ACU=3_frMkDp9UUeuZoAMjaK1y0Z_q5RFNbGvwi8NM==AA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 26, 2022 at 1:20 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Sat, Feb 12, 2022 at 6:26 AM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > FWIW, here's a patch just adding a comment on how the startup process
> > can get a free procState array slot even when SInvalShmemSize hasn't
> > accounted for it.
>
> I don't think the positioning of this code comment is very good,
> because it's commenting on 0 lines of code. Perhaps that problem could
> be fixed by making it the second paragraph of the immediately
> preceding comment instead of a separate block, but I think the right
> place to comment on this sort of thing is actually in the code that
> sizes the data structure - i.e. SInvalShmemSize. If someone looks at
> that function and says "hey, this uses GetMaxBackends(), that's off by
> one!" they are not ever going to find this comment explaining the
> reasoning.

Thanks. It makes sense to put the comment in SInvalShmemSize.
Attaching v2 patch. Please review it.

Regards,
Bharath Rupireddy.

Attachment Content-Type Size
v2-0001-Add-comment-about-startup-process-getting-procSta.patch application/octet-stream 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-03-26 05:46:45 Re: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.
Previous Message Michael Paquier 2022-03-26 05:33:46 Re: pg_tablespace_location() failure with allow_in_place_tablespaces