Re: 'Shutdown <= SmartShutdown' check while launching processes in postmaster.

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 'Shutdown <= SmartShutdown' check while launching processes in postmaster.
Date: 2024-02-21 12:01:43
Message-ID: CALj2ACXsp0J4nGp8xMYHKPLGm2uY16c++3OHVUrPP-v9C-ec_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 21, 2024 at 3:38 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> > Children that are stopped by the "if (pmState == PM_STOP_BACKENDS)"
> > stanza in PostmasterStateMachine should not be allowed to start
> > again later if we are trying to shut down. (But "smart" shutdown
> > doesn't enforce that, since it's a very weak state that only
> > prohibits new client sessions.) The processes that are allowed
> > to continue beyond that point are ones that are needed to perform
> > the shutdown checkpoint, or useful to make it finish faster.
>
> Thank you for providing the details. It clarifies the situation. Do
> you think it would be beneficial to include this as a code comment in
> postmaster.c to simplify understanding for future readers?

+1 for a note either before the StartChildProcess() or before the
PMState enum definition.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-02-21 12:25:25 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Bertrand Drouvot 2024-02-21 11:50:21 Re: Injection points: some tools to wait and wake