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.94.2) (envelope-from ) id 1ueOSV-009KV6-0V for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Jul 2025 01:39:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ueOST-00Gu73-Vs for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Jul 2025 01:39:50 +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.94.2) (envelope-from ) id 1ueOST-00Gu6v-Ee for pgsql-bugs@lists.postgresql.org; Wed, 23 Jul 2025 01:39:50 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1ueOSQ-000Irt-1v for pgsql-bugs@lists.postgresql.org; Wed, 23 Jul 2025 01:39:48 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id A40AD1D000D3; Tue, 22 Jul 2025 21:39:45 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 22 Jul 2025 21:39:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1753234785; x=1753321185; bh=nbM1yrZRv+ ABi2aufSZLtm4tBIwBuFIJRCSQe1l23WQ=; b=ap+l5N9NSM67mJ/8CQXLE8z9Uk 8fs2qJpUfS6zwA0fojaxYp9jysxXPJ2IatAgE1lcs9ms0wQ4n1Gc4Ar1fB+qfZVW QY0FF/G4npt9Q027N6tmE00UOJvv6svzjGF1CeaqtJ8ZAXSTlzj2q1lScWzSy9xJ 9J+2S9CCqHqii/j761RCUmYI4xuvDLSnvoPF53GLec3fhdmytnlrrgInzhmDkWsG kSCWvC6cN7T++FagcnJpNqjidmhUUJmvGUqAVRzAC2ywKAQUgZHiPAiYFsl4hS9K lG69jcYG1Mhmf+EKzFTzzb7zXDWB8evIe8OYi7l/qohBhXNdEk2R2gw4kN0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1753234785; x=1753321185; bh=nbM1yrZRv+ABi2aufSZLtm4tBIwBuFIJRCS Qe1l23WQ=; b=Wwlk20+hf8apPVHpDQk68qdEvgGJpMNNIxssnu+C9y37l23Jwup PJNLJBiwmky6/F71dScxwsSge7U9toMgx/5OOqIYevmrkYj1aLYtB1+6v0RB+peB 5FiYL4gWm53ml6iBzx64XQ7cRu9fofDpJ1bKVeKDt7NEum0aF/NUc+CZ1QTXeTMT a6QcapjXNpCFgeh3ol9tnDjvoM1BGnhlhyUtuhCmp51vzkTUcvjY7v4rea8+YEyr MyBGPGnf80L/9ZK5Ii6AsE+mwGiyHsYUQWx1kA6KIv7bDMrTzVDjwlkgDFz4g3De Z7AwDymFVTxR2lgvdTfHA6yhBlx2/9ojK8w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdejieegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtjeen ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeevteejgfejveegudekheeiueeiueei veeuiedugeehveeugffgudeuleegleeiteenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrrghhih hlrghshigvugeltdesghhmrghilhdrtghomhdprhgtphhtthhopehthhgrrhgrkhgrnhes ghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrph hoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepughilhhiphgsrghlrghuthesghhm rghilhdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Jul 2025 21:39:43 -0400 (EDT) Date: Wed, 23 Jul 2025 10:39:30 +0900 From: Michael Paquier To: Rahila Syed Cc: tharakan@gmail.com, pgsql-bugs@lists.postgresql.org, Dilip Kumar Subject: Re: BUG #18992: Autovacuum triggering assert - LWLockAnyHeldByMe Message-ID: References: <18992-b0add0a16bbf4ca9@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QFFwrbbTj818QIsM" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --QFFwrbbTj818QIsM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 21, 2025 at 12:51:14PM +0530, Rahila Syed wrote: > This appears to be a valid issue where the Autovacuum worker fails while > already holding an > LWLock on one of the pgStatLocal.shared_hash partitions. As a result, when > we attempt to > access this table again during proc_exit cleanup in dshash_find, the asse= rt > is triggered. I haven=E2=80=99t > yet checked exactly where the lock is acquired within the Autovacuum > worker, but as Dilip mentioned, > reviewing where the error occurs in the Autovacuum worker would be helpfu= l. Per dsm_attach@dsm.c, about the original FATAL message "can't attach the same segment more than once" that triggers the assertion afterwards: * If you're hitting this error, you probably want to attempt to find an * existing mapping via dsm_find_mapping() before calling dsm_attach() = to * create a new one. One thing that we could do is to upgrade this FATAL to a PANIC, to get an idea of the stack where the original problem happens. The stack is referencing a backend-level stats getting dropped by an autovacuum worker as a result of pgstat_drop_entry() done in pgstat_shutdown_hook(), so it looks like we are reaching a new error state in v18 that could not happen before within the DSM, as an after effect of the FATAL causing the autovacuum worker to stop. Never seen this one. We're already doing stats reports in the pgstat_report_stat() call with manipulations of the pgstats=20 dshash while shutting down. objid at 5015 means that the procnum is set as such. How many max_connections do you have? It seems like a high number points to a better reproducibility. Robins, is that your host with gcc experimental? Could it be possible to re-run the test with a patched build with the FATAL upgraded to PANIC and see what happens? -- Michael --QFFwrbbTj818QIsM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmiAPVIACgkQnvQgOdby QH2Txw//bP0/Wmp9//v+QfqEEnHBHJuvLb4ZvjD5mWZ4/nKkjGfPa3+9X42ssMbw 5YzpydGrcuutMq0EMlaPlaKq7aSclFO1i9dqFHmoAWprglREIR2D72Yc+J+iDP96 k12VYfX0OIi5PEVA/UzfYxYJKTWfX/0XsbwilF9jEcl4ebLvUX78oGOOqr7pYZLv lZghmvSHFr96I4UKr5ou5A1eN85NOJEdrisGr2J/wKtndDXi2wBnRA/bKg/fwHVN VyoctYo9lsbuKBt5FI+reoqlFiewA//eKGwBYv7jgizt3WDgBvc1qRA1Y/h7KOgt bdpfPSMqTGwzg1gAT4J0tSXDvO6gSTRpj1sKKv+hYsRy15t22Ba8aWBAoRqkftiz Hqtsw1LrnOtsR6EtpPt5Qia34H0qHBOnSp8bsb9rxAWJ59a1pD0RksmRZrRgUC24 YssFV0TBIpXa4PBaklf9wDf7/xjpdhb/L8/UMz66EoOaJdVek8dX5mOj1A4qUvXd lQsLW3j5cnZ8TFsvqrjVMt8Wt3IF0ugJS8Ku7fDhwnV1rqA+sheimkZd45UvB+Jg zjKRj3IuqTXBQLhinBjebOd0wJA8tksu+ss2bqgVnasYanymtjQIiPQXHFdfugcX qpwQ7csDMr6cZZ2Fzm+1GxWFzj7jsubtOv333L7O4f02GLnMYUs= =XedE -----END PGP SIGNATURE----- --QFFwrbbTj818QIsM--