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 1wCp5E-002L8F-23 for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Apr 2026 01:30:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCp5B-00DsI8-22 for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Apr 2026 01:30:22 +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 1wCp5B-00DsI0-0z for pgsql-bugs@lists.postgresql.org; Wed, 15 Apr 2026 01:30:22 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCp5A-0000000188S-00ck for pgsql-bugs@lists.postgresql.org; Wed, 15 Apr 2026 01:30:21 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-b941762394aso762845566b.1 for ; Tue, 14 Apr 2026 18:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776216619; cv=none; d=google.com; s=arc-20240605; b=f6+SQyYFWUqt3E/yw6A0MNQbDzYaqZwbSV28dy7VMiCNUv6brIxOs/YK1DXUFmrSb0 1JPuew8VxCmF8JCfaSmZmpJp5viFPd1O9s/3olnHsfRsczrTxHzwEQ287G5QByzjNAK8 As9jqGTNiwFtlIKZGNA73x6TbxmP8/mg2BVwpXD5zbNDv5fHyrEkVNLXSCUKvwQmeKqj b3jwrekbv82LPlrQWhJOGGxH/8t0FIX5BbQtZGyI5ey1cO8s/TXg44CpHvIvRzpCUSkN C+DRlZdXALCV4bbccXTnGIjm1iv9pNbDmE6P8y7q9qVdkCs7qK5FDWBJPEy+eO7ZC7Db Osmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=U5Je8Mwd/SI1jIwy6u3/Atf2HjC85/8GxDjzUi+W3/w=; fh=SVWO1+Ug9PAju5ITYBEi3OVUKFND2JXE51CsWDklBIY=; b=gnXEVNL4b0o3Uh0sxzUEZc04sa4oAsVaXJSZzZ1VqFPkz9Ghm9MKmFcPZMMaAq3rsl gRlwZWVyMbaWfMIRFK0G4X6NokbpbiLTOaYwzQBxwc/UIPkqeELeTbYJTUWhcuzCBTNF L1eYVW0GZKJYxlpO3VipJH44qlcyjGz01mhTaoL0Be/cUW2ko62irJzryf6x7ItigwqP 1b//bETMordh+hpRa2jjJy+DmblCjo/saPSy7KIBSBHMhASX7fEkds94SJajrzlO+V6S G+JhuPkgPKidDrfush2kPFa4QYOYRNzYHLWyIdt3JID8/fc8I0rLNMxT3eI89fvfxPT1 auEw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776216619; x=1776821419; darn=lists.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=U5Je8Mwd/SI1jIwy6u3/Atf2HjC85/8GxDjzUi+W3/w=; b=a0QvKNCJEbJvClvivQLwvPrLHc7oxSS++341eBxdhlwLRL39bL3FandAnrb8PQfMFt LZwrFG/HKoG8XZNiXl2skRgj9CQsruiv6zwkV948j41kWccDB0t5aDIN7tKyUzNi6b2C /ZUfwJNzdMlDBDs0M1jf56g3GBeyCwJMzXPQDtqyh7kEtPhYxBwgCQGiuWV3FYgI+q7G JKxUosuRe9kemGem0+SLSc94upAZh/jm5BQ8dg6hBSVp05cG1BxWofxY6q7l4ZdDVpEL n+AkTx+zE8BjFwBaga/jm/LDkZ/0gPvzq+0zwVtHw0fgkxxJRwHOkRVRtDs87iwPyy3j gHeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776216619; x=1776821419; 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=U5Je8Mwd/SI1jIwy6u3/Atf2HjC85/8GxDjzUi+W3/w=; b=jK2a6OXtT5fnsceLm1/qOJwG+4ProSuFbC++KC87MvlW3lo/4NhR6VtVo0StE+5MEj ZSo4CwkQq197INAvljUYffgzUHJpXbbN4zE+7+2bHmvDAbNC1JFT2LuJoqnulkEXFbKc 4gzha1yGYACUEa0Os3AMOcOd9JL19WgOhRq/W+BY9X0s8j+3LVOpfWqjiz9Qkg+ym29i qa+hLaCZ3fT8n2hTOJpt4wJkjoVe74GZ7ZuP10+DSD0x0Tf6qlsXNRsTd5BaVxkwGYGI PdDeYmg4B9j2ZrMINjThXkVtee2GMT3WhPa/io7DIifCqfPYX5v6VK0IXA8Ae0okn97n Aqng== X-Forwarded-Encrypted: i=1; AFNElJ/shWUiMOD5WAJDq97WG74vdIR/6FA5DvlAfWsMebgzzCh9HcnM/HV66fsbFU27oUywzsfpjflIsr6b@lists.postgresql.org X-Gm-Message-State: AOJu0YxQ8XgCV1zMo0+2AzaHi9k2q/B28W+LnYznGRTAvYMFtWqY/cWg bzf5NGveKd0+n65CbHqD05U7DcXKGsn7Khjt0+4N5x2BW5mpPe+RRrq4LdrVQWzvAYyb/DDplMR Q2UGrYYItgcEdUITfEAJW7LZH1AUksFg= X-Gm-Gg: AeBDiesGx1c8nF9uSU9KAVUYWqdBAxaYV2vXO+l7bh6FXlv6AbcL37ubN30Z5ZLAy0r ZB6Wb8AF8oo0dmOyyRCqnt0v7zei+AdSG2ez1cN9F8UHZjHsSpurlYaYDlX1pqphEXcQ6RdXpn7 Jr2kbZoN50uLX7ldxNtmIQ1aPHcmofYdTs6t1/dBBpLlhX+4DhGjb1yNBrq1LGT4Ksp0O/IM8/d KSuTnaXawPOs7mcXGTG9fbFSnIoHz6m5udghyoambsVFk+DKYn+1xOFRSjOdopt1ta6TqXwh5C4 J0ibbWWNa9xGOX06Yfxw3ynM3s9p250Lu7lq4Xh5StoTvVuBO8HwsYWnLNeDwc2c9OncfiP7uKH Bum7Qx5L5eOwdJ7F5VQ== X-Received: by 2002:a17:907:3c89:b0:b9c:b808:4617 with SMTP id a640c23a62f3a-b9d72499227mr1222949066b.7.1776216618582; Tue, 14 Apr 2026 18:30:18 -0700 (PDT) MIME-Version: 1.0 References: <323816.1775874176@sss.pgh.pa.us> In-Reply-To: From: Xuneng Zhou Date: Wed, 15 Apr 2026 09:30:05 +0800 X-Gm-Features: AQROBzBvNNXHvsqZaD5mkwGgXPCtmW4xSW7_lVD5f5mUswJxjSWbr-fK1XW9eLs Message-ID: Subject: Re: BUG #19006: Assert(BufferIsPinned) in BufferGetBlockNumber() is triggered for forwarded buffer To: Michael Paquier Cc: Tom Lane , Thomas Munro , exclusion@gmail.com, pgsql-bugs@lists.postgresql.org, nathandbossart@gmail.com, Melanie Plageman , Heikki Linnakangas 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 On Tue, Apr 14, 2026 at 1:24=E2=80=AFAM Michael Paquier wrote: > > 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. > > > > 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 p= urposes > >> * 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 manag= e 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 > > > > 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. > > > > 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. +1. -- Best, Xuneng