Re: Some shared memory chunks are allocated even if related processes won't start

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Some shared memory chunks are allocated even if related processes won't start
Date: 2024-03-04 05:33:52
Message-ID: 3502627.1709530432@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> writes:
> While reading codes, I found that ApplyLauncherShmemInit() and AutoVacuumShmemInit()
> are always called even if they would not be launched.
> It may be able to reduce the start time to avoid the unnecessary allocation.

Why would this be a good idea? It would require preventing the
decision not to launch them from being changed later, except via
postmaster restart. We've generally been trying to move away
from unchangeable-without-restart decisions. In your example,

> + if (max_logical_replication_workers == 0 || IsBinaryUpgrade)
> + return;

max_logical_replication_workers is already PGC_POSTMASTER so there's
not any immediate loss of flexibility, but I don't think it's a great
idea to introduce another reason why it has to be PGC_POSTMASTER.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amul Sul 2024-03-04 05:34:56 Re: Add system identifier to backup manifest
Previous Message David Rowley 2024-03-04 05:33:06 Re: a wrong index choose when statistics is out of date