Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wgcqW-006Iai-2w for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 06:30:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wgcqU-00FLBo-2A for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2026 06:30:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wgcqU-00FLBg-0z for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2026 06:30:22 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wgcqR-00000001leG-148s for pgsql-hackers@postgresql.org; Mon, 06 Jul 2026 06:30:20 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-8114a4542b2so39867947b3.1 for ; Sun, 05 Jul 2026 23:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783319418; cv=none; d=google.com; s=arc-20260327; b=fBcogZdsUtDzICTheh8VK1xrp6T+J3TaF80Kk0dHy9dWqWjcQubCtx7SLgpJGDiaR+ PD2bNFaAbLBllR4qS8RF4MAlYrUujSZSzoT0M1tZubpz937rXGuNVCISfZUPgj2Ovbuk Q4DzSPcbBC8I7oqy7lldqBbs5D1KE+WR0al9sQr70J20dF511qizgCgjABXZFfohh2N2 TmHY7Wjnw1wWtEULzengE34mPvZOVZnqyVTTtI09FJYDF56rRe7ENoAtn8Tqm6AC0Bid ZhZCawkXBbW8Oy81NLN5QnPuiCfSD0vNEwGJXwr57z8OyNp6mZAnm+Is5IeFlSf66l50 iptw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mKdi/WYQdD0tk64OPYH5QYokv+YvUNCP6CHuTb+OGP0=; fh=brSAWzwJ5QEuJ1qzZK46iuk41pBaAEThF0r52qwAxKk=; b=ELIBWJ+vFVEHt2ATOJ6BUQJ1ZuZyYVRG1PSnidNNOnSBBe3gVW1gbXJqGmHgtG/CZ/ Zln7Z7l3g7ki5FetfyPp0q82KZ8MCGuW2K+oajTekR6xD482KCHZ4LcpsVKOSLNsP8Au 9liCBs2GxCzELi935z+zinfHh0tG0rnBSeXOxcS4va2c/13Toy3EJ3t9AlQwcp4NXItC NPC+3ucOGNyH78Iyxot4+piA6aGONbw8wVkgV9E3fb7NFImkykIepwu+yCO7rzZomq/k vyc6lnLRwPfP2y3EAiJBHRdzd4+NXWmyH5BoWIzPoNCQr+SD0KVYAYuJF7YxCuHSasZI LhiA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; t=1783319418; x=1783924218; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mKdi/WYQdD0tk64OPYH5QYokv+YvUNCP6CHuTb+OGP0=; b=e3mz9T2akdjE1gu9SpgufuGILmmXQey+iuH0l8ksz230F4vG6d7I145tmDlPkOR0/B vRsFbgVk+Xl9yilVJKwSbW1jMa95DOIEA/G1C9cYk+ZM4pI7J/qUhvOilEoj6nkMQ3S5 TnTOczyBR8DFqyE0C+boh2VuU547BSyuB0WyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783319418; x=1783924218; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mKdi/WYQdD0tk64OPYH5QYokv+YvUNCP6CHuTb+OGP0=; b=e15YavzsDsoRmf4NFNluukHXx7ZNnNCO2J6od9Kz1iluoTmSwqox0puoL++VUvLSUe 7q3XZztABFVvZ+nWCy6R0k0z+1NIr7MzxUgNjl2GStcoiqjTyu3V96Cd7dRLo/4+MEQP 6Q7jCLuzxMlesqL5FRjN3CYCPlUBF7fAWdzA9UJslxwLkOaVRMgId72GhWz7zw0QYlnh z+MoGLGHu8jfBHqbFTACJbomLrKMi4bDkQTMKXAgtIC3BfTs1nTK4c2zHyArXM0L0WpQ PYWwh9ME4b7iHp2LSSbs7VQXT9xisLjaHKHFCrZZGnmujGwxbyfOlTYGMeoo8qO6RaPz dxUg== X-Forwarded-Encrypted: i=1; AHgh+RrsP4KU5iPGnDr5eCDBn3KyMonFFvuOrMRudzsiwm++kq3XPjGuyxxnyBPdsDXlEvYonAUqK4dJurhHdFZ8@postgresql.org X-Gm-Message-State: AOJu0YzzxmWFd0uKCTYU86evDskHxlduiu5XwSDTLNyP7ufRBkRzilu6 mL5d+mUBsDicmyKib4u6mjLhOsT9UMeoqvdT9E1AScI1YUoGWRlpamHyaC5ZPdN7eMfa+wg0vEH lQiYJtLA663Qaf++2GA4FbFEjFq+ZG0/YJrx+bboolg== X-Gm-Gg: AfdE7cnN9DiDFzz78jbqdTfM4yXAUo2+lyxfq7XbRpfT2VwzNfml2YGY4/ZSdCOYItd fldbAmukR0km3PwcqhiXeboBnhibQZRE+59/gF5269NGyP4YFYW5W44s4Lw3z9uubrIL4Gtif/N sZwSgV8GLHd2yLdE5043/OYmOapBtMeAyxyDb5rLzmiw2/lLP1UKNymM38z4U+GRhMYmoeUW6FR uUEpuWfHBZNqthCxBIEajo7UVfuJg6HJ4EQby8nf/tpwsVJmOlf1HpzI6zyO34dSW+ir8g= X-Received: by 2002:a05:690c:4984:b0:812:8f06:77ab with SMTP id 00721157ae682-81739cebc23mr73249017b3.38.1783319417769; Sun, 05 Jul 2026 23:30:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anthonin Bonnefoy Date: Mon, 6 Jul 2026 08:30:06 +0200 X-Gm-Features: AVVi8CfK0jWfVC48eF6c-Rv4ICHTU7V2hgSnaPHt5RDAKibb2jqfeDsWHg4eBRY Message-ID: Subject: Re: hang during shutdown To: Srinath Reddy Sadipiralla Cc: Jeremy Schneider , PostgreSQL mailing lists Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Jul 5, 2026 at 11:55=E2=80=AFPM Jeremy Schneider wrote: > so far, it all started with this postgres hang during a shutdown. we didn= t capture enough diagnostics to root-cause the domino before the hang, but = the data i do have about this postgres hang is very peculiar. i'm working o= n some automation to gather more diagnostics if there is a recurrence. in t= he meantime i wanted to share what i do know, in case anyone else has seen = something similar. > > postgres version 16.13 > Ubuntu 22.04.5 LTS > kernel 5.15.0-1110-azure > > between log messages and wal contents, it appears PostmasterStateMachine = transitioned into PM_WAIT_BACKENDS but never progressed beyond this for a f= ull 30 minutes until external automation finally killed the processes. 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 that can be stuck in an infinite loop when the WAL is in a specific state (last record is a rollback crossing the WAL page boundary). A fix for that was released in the latest 16.14 minor release[0]. [0]: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h= =3D82935467a Regards, Anthonin Bonnefoy