Detach shared memory in Postmaster child if not needed

From: "Rui Zhao" <xiyuan(dot)zr(at)alibaba-inc(dot)com>
To: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Cc: "hlinnaka" <hlinnaka(at)iki(dot)fi>, "robertmhaas" <robertmhaas(at)gmail(dot)com>, "tgl" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Detach shared memory in Postmaster child if not needed
Date: 2024-07-29 09:57:06
Message-ID: 11505016-8cf3-4691-b996-7faed99b7877.xiyuan.zr@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.
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.
The attached patch addresses this issue by detaching shared memory after
fork_process().
Best regard,
Rui Zhao

Attachment Content-Type Size
0001-Detach-shared-memory-in-Postmaster-child-if-not-needed.patch application/octet-stream 997 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2024-07-29 09:58:34 Re: Add ALL_CANDIDATES option to EXPLAIN
Previous Message Daniel Gustafsson 2024-07-29 09:56:55 Re: tls 1.3: sending multiple tickets