public inbox for [email protected]  
help / color / mirror / Atom feed
From: Robert Haas <[email protected]>
To: Rui Zhao <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: hlinnaka <[email protected]>
Cc: tgl <[email protected]>
Subject: Re: Detach shared memory in Postmaster child if not needed
Date: Mon, 29 Jul 2024 14:10:27 -0400
Message-ID: <CA+TgmobgW-hyqJwVO+J-Lf+o51Uw8ays1swoHz1Jtb4QX2S7=g@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Mon, Jul 29, 2024 at 5:57 AM Rui Zhao <[email protected]> wrote:
> Prior to PG16, postmaster children would manually detach from shared memory
> if it was not needed. However, this behavior was removed in fork mode in
> commit aafc05d.

Oh. The commit message makes no mention of that. I wonder whether it
was inadvertent.

> Detaching shared memory when it is no longer needed is beneficial, as
> postmaster children (like syslogger) don't wish to take any risk of
> accidentally corrupting shared memory. Additionally, any panic in these
> processes will not reset shared memory.

+1.

> The attached patch addresses this issue by detaching shared memory after
> fork_process().

I don't know whether this is the correct approach or not, but
hopefully Heikki can comment.

-- 
Robert Haas
EDB: http://www.enterprisedb.com






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Detach shared memory in Postmaster child if not needed
  In-Reply-To: <CA+TgmobgW-hyqJwVO+J-Lf+o51Uw8ays1swoHz1Jtb4QX2S7=g@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox