| From: | Jeremy Schneider <schneider(at)ardentperf(dot)com> |
|---|---|
| To: | Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com> |
| Cc: | Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: hang during shutdown |
| Date: | 2026-07-09 02:49:51 |
| Message-ID: | 20260708194951.34705f93@ardentperf.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, 6 Jul 2026 14:42:10 +0200
Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com> wrote:
> On Mon, Jul 6, 2026 at 8:30 AM Anthonin Bonnefoy
> <anthonin(dot)bonnefoy(at)datadoghq(dot)com> wrote:
> >
> > Hi,
> >
> > On Sun, Jul 5, 2026 at 11:55 PM Jeremy Schneider
> > <schneider(at)ardentperf(dot)com> wrote:
> >
> > Did you have an active logical replication stream at the time of the
> > shutdown? If so, it's very likely due to a bug in the logical
> > walsender[..]
>
> Aren't walsenders in general problematic for shutdowns? (not just
> logical, of course it might be this). The PG 19 is going to have
> wal_sender_shutdown_timeout, and from description it seems to match
> [0] to something like that. 'netstat -ntpo' would help to see from
> such hanged system (if walsenders running there at this point at all).
Between log messages and wal contents, it appears
PostmasterStateMachine transitioned into PM_WAIT_BACKENDS but never
progressed beyond this. I don't think walsenders are involved until it
transitions into PM_WAIT_XLOG_SHUTDOWN which doesn't start until after
the shutdown checkpoint (which never arrived in the wal).
I remain pretty stumped :)
I have put some code together that can automatically capture cmdline,
comm, status, wchan, io, syscall, stack and sched from /proc for every
single process in the postgres namespace/container. If privs are
missing (stack is probably usually blocked) then it'll still capture
other files. My initial prototype does three captures, with 3 seconds
in between each. This can help determine whether processes or stuck or
slow.
I'm still figuring out how to trigger it at the right time, because the
SIGKILL was triggered by terminationGracePeriodSeconds on kubernetes. I
didn't find an obvious way to just run diag at the end (I think preStop
hook fires at the beginning). I'll figure something out.
-Jeremy
--
To know the thoughts and deeds that have marked man's progress is to
feel the great heart throbs of humanity through the centuries; and if
one does not feel in these pulsations a heavenward striving, one must
indeed be deaf to the harmonies of life.
Helen Keller, The Story Of My Life, 1902, 1903, 1905, introduction by
Ralph Barton Perry (Garden City, NY: Doubleday & Company, 1954), p90.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nathan Bossart | 2026-07-09 02:50:33 | remove WaitEventCustomCounterData |
| Previous Message | Fujii Masao | 2026-07-09 02:24:31 | Fix data checksum processing for temp relations and dropped databases |