Re: processes stuck in shutdown following OOM/recovery

From: Kirill Reshke <reshkekirill(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)postgresql(dot)org, Thomas Munro <tmunro(at)postgresql(dot)org>
Subject: Re: processes stuck in shutdown following OOM/recovery
Date: 2026-11-09 12:10:52
Message-ID: CALdSSPineiNEHEL=GjGbJqv8=oNeY91ddOSHRtekwWBfBonzhw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 3 Dec 2024 at 14:43, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
> On Wed, 6 Mar 2024 at 02:22, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> >
> > On Sat, Dec 2, 2023 at 3:30 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> > > On Sat, Dec 2, 2023 at 2:18 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> > > > On Fri, Dec 1, 2023 at 6:13 PM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
> > > > > $ kill -9 2524495; sleep 0.05; pg_ctl -D ./pgdev.dat1 stop -m fast # 2524495 is a child's pid
> > > >
> > > > > This affects v15, and fails at ) but not its parent.
> > > >
> > > > Repro'd here. I had to make the sleep shorter on my system. Looking...
> > >
> > > The PostmasterStateMachine() case for PM_WAIT_BACKENDS doesn't tell
> > > the checkpointer to shut down in this race case. We have
> > > CheckpointerPID != 0 (because 7ff23c6d27 starts it earlier than
> > > before), and FatalError is true because a child recently crashed and
> > > we haven't yet received the PMSIGNAL_RECOVERY_STARTED handler that
> > > would clear it. Hmm.
> >
> > Here is a first attempt at fixing this. I am not yet 100% sure if it
> > is right, and there may be a nicer/simpler way to express the
> > conditions. It passes the test suite, and it fixes the repro that
> > Justin posted. FYI on my machine I had to use sleep 0.005 where he
> > had 0.05, as an FYI if someone else is trying to reproduce the issue.
>
> Hi!
> This patch needs a rebase.CF entry status now is Waiting On author.
>
> --
> Best regards,
> Kirill Reshke

There is fix here[1] so I closed
https://commitfest.postgresql.org/patch/4884/ CF entry

[1] https://github.com/postgres/postgres/commit/12f866cd5f7

--
Best regards,
Kirill Reshke

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2026-11-09 12:20:44 Re: log_postmaster_stats
Previous Message Daniel Gustafsson 2026-11-09 12:09:09 Re: Add a hint to the "WAL summaries are required" errors