Re: Accommodate startup process in a separate ProcState array slot instead of in MaxBackends slots. - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Accommodate startup process in a separate ProcState array slot instead of in MaxBackends slots.
Date
Msg-id f41d38c9-a81f-bd33-0417-b4c9a8c453f7@oss.nttdata.com
Whole thread Raw
In response to Accommodate startup process in a separate ProcState array slot instead of in MaxBackends slots.  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Accommodate startup process in a separate ProcState array slot instead of in MaxBackends slots.
List pgsql-hackers

On 2021/10/12 4:07, Bharath Rupireddy wrote:
> Hi,
> 
> While working on [1], it is found that currently the ProcState array
> doesn't have entries for auxiliary processes, it does have entries for
> MaxBackends. But the startup process is eating up one slot from
> MaxBackends. We need to increase the size of the ProcState array by 1
> at least for the startup process. The startup process uses ProcState
> slot via InitRecoveryTransactionEnvironment->SharedInvalBackendInit.
> The procState array size is initialized to MaxBackends in
> SInvalShmemSize.
> 
> The consequence of not fixing this issue is that the database may hit
> the error "sorry, too many clients already" soon in
> SharedInvalBackendInit.
> 
> Attaching a patch to fix this issue. Thoughts?

Thanks for making the patch! LGTM.
Barring any objection, I will commit it.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg14 psql broke \d datname.nspname.relname
Next
From: Masahiko Sawada
Date:
Subject: Re: Parallel vacuum workers prevent the oldest xmin from advancing