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 1wCL1B-001szL-0f for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Apr 2026 17:24:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCL19-008Cop-1e for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Apr 2026 17:24:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wCL19-008Coh-0s for pgsql-bugs@lists.postgresql.org; Mon, 13 Apr 2026 17:24:12 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wCL18-00000000sLN-0Nwq for pgsql-bugs@lists.postgresql.org; Mon, 13 Apr 2026 17:24:11 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 04A46EC04E3; Mon, 13 Apr 2026 13:24:08 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Mon, 13 Apr 2026 13:24:08 -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=1776101048; x=1776187448; bh=147/fSjVH2 yyIblBdk99Qcl+wZ5oHnbbn3oO8YNUIl8=; b=HvQ/N8eK0D9zApX9q0V5LYlX8A JgbBIk9qvcmeoVjZudKzmyvIyf5XEYQX8bZ3Y2WrRSYv7SS8BhhxVa4ibWpQw4i/ sE4CWwLR3ljNKMRTDJb+QlCMABOi0Qp7qOA1zo8CSFGEBXWgX9QA2aMUMP1ElSyr CtjwXZrGn1JG6GTr9ZrZuMwqmVpVLVgJmmlPIEgFhvDXijk4CDBnUG61hE2I8Oho 6IzT9afVg/SP/m10P3QgPLAJb03migs27bApE42vwqnq9pJcuxuvPnBTeCbDbbAp POe7Lem3WxT4krzZIAymNuAl1YI8tHEF1pckZ+sewoRLbh9O6iC8BvQQ5VuA== 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= 1776101048; x=1776187448; bh=147/fSjVH2yyIblBdk99Qcl+wZ5oHnbbn3o O8YNUIl8=; b=ScVl/B3d4PngriRrG6kiMOy0F8VhZvwu2+gSknVDEmeUgXa9KFw nynV6OvT9GI24NHL7Dz85kF9Xw4eWoXscPXj4GnQ7M0erLTMMRtu8dl+GbpK/NJJ oyh5p75HhBjxCHa6NZq9U0rN8ML5YL6kKZa8Fz91gGilL1npX1NTpPRCQ+5bUMYd mE6/SFwfi91yHziGSpGuK2W9dteY2km4at+mMEcKMjlT4z4gjxI3L0pe8QI/BYt1 rsA0tpN3UJeZo9sSzI3UF/Hf/ca7UPMLp1gTQdmIwKHJiIZ8rQ+A7sH7zJ/pcQXJ JrxfsSNTsvHFrbYaxAzl+lBIvcs4SntyRIA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdefkeekvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeekpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehtghhlse hsshhsrdhpghhhrdhprgdruhhspdhrtghpthhtohepthhhohhmrghsrdhmuhhnrhhosehg mhgrihhlrdgtohhmpdhrtghpthhtohepgihunhgvnhhgiihhohhusehgmhgrihhlrdgtoh hmpdhrtghpthhtohepvgigtghluhhsihhonhesghhmrghilhdrtghomhdprhgtphhtthho pehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtg hpthhtohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthht ohepmhgvlhgrnhhivghplhgrghgvmhgrnhesghhmrghilhdrtghomhdprhgtphhtthhope hhlhhinhhnrghkrgesihhkihdrfhhi X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Apr 2026 13:24:06 -0400 (EDT) Date: Tue, 14 Apr 2026 02:24:04 +0900 From: Michael Paquier To: Tom Lane Cc: Thomas Munro , Xuneng Zhou , exclusion@gmail.com, pgsql-bugs@lists.postgresql.org, nathandbossart@gmail.com, Melanie Plageman , Heikki Linnakangas Subject: Re: BUG #19006: Assert(BufferIsPinned) in BufferGetBlockNumber() is triggered for forwarded buffer Message-ID: References: <323816.1775874176@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gSeIl3HZvrLx3Rfq" Content-Disposition: inline In-Reply-To: <323816.1775874176@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --gSeIl3HZvrLx3Rfq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 10, 2026 at 10:22:56PM -0400, Tom Lane wrote: > Thomas Munro writes: >> Unfortunately this fell through the cracks (sorry) and I didn't push >> it before the freeze. Any objections to pushing it now? I can live >> with deferring it until master reopens if that's the call (CC RMT), >> but it would be nice to tidy up this design wart if we can. >=20 > This doesn't seem to me to be a "new feature", so I'm not sure that > feature freeze applies. I have read the patch and I would agree this stance. >> * it now seems obvious that StartReadBuffers() should just allow an >> in/out npinned counter to travel along with the in/out buffers array >> * read_stream.c still needs to know how many there are for pin limit pur= poses >> * it also needs to know in the unusual case that the stream ends >> earlier and it has to unpin them >> * other than that, it's StartReadBuffers()'s private business to manage = them >> * StartReadBuffers() can do that with trivial arithmetic, no need to >> distinguish and count the buffers >> * the end result is much simpler and more robust >=20 > IIUC, this is basically fixing StartReadBuffers' API, and if we don't > do it now then the v19 code will differ from both earlier and later > branches. That doesn't seem like a great place to be when you think > about having to back-patch bug fixes in this area. >=20 > So yeah, squeezing this in now seems like a good bet to me. +1 for doing it now. It's also worth noting that this shaves code line-wise. -- Michael --gSeIl3HZvrLx3Rfq Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmndJrQACgkQnvQgOdby QH1oDQ//aHznUN++R//Jbofb2kEZPnz0GhTW+5bIYY9V+I+hwwwkEpVVvTLxJagU jy6cTdD7Ky0C7uuwWOV33vMTl+RUONHFu2x2X1j7plf6w+P/HpJO2Fjo3IQj0/yc LXWGnAYgj9CUKy9t0Sf28sE0Pq9b1A0VpUxEmZQUJAqdQkO3Laz3vxh/snnE4cyg q4gabFeDfy4iJiBMD/JXfVG+f64vjQIxIJAYBg2P9Izha89PhEWVedkoF+B0OBV4 D/8ZagYfKXw811FYLcIhunYHOs+MIf6y5K/nH7qGOyV4Gde3f3SsyhlYopLWqhpr 4uSCFCHIVT1JQEFMAX025K78OgAolhudg22S2W9DefWsxU90bplbf09HgH8UIoHb JavDpXwjoJ5kZlQFv9s+65xHdbaB/OI+fDNgYTmXa3Ix9yvlXpDS2IZHeygfAWvg 2kBduf5U4Yh0RCCBCma73mRP2YPOb8zPZmHrx2a/OUmr6QpIM87yz4dM4IE/MhwT ijF73C8sTu5FyuJ+6fbLsiess1M2ZlkWQb8KtDv7eP+1PtonYHJ6ogmtO/8iXw08 FOQ4kshIPo9ZW+T6zGbZ0gz1Ur2dVssx8/Nq21kd/0wKmoYKA0HAjtn78TbhwDn0 EUVRC2CNc8XrlJalGP0ZEgij6nBARhea1yHQjUXd+NT+7ZerpPs= =7n1D -----END PGP SIGNATURE----- --gSeIl3HZvrLx3Rfq--