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 1w9Pj1-001PiZ-0k for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2026 15:49:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9Piz-003hg7-2B for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2026 15:49: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 1w9Piz-003hfy-1D for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2026 15:49:21 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w9Pix-00000000kTA-1HZU for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2026 15:49:21 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 7D39C1D00231; Sun, 5 Apr 2026 11:49:17 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sun, 05 Apr 2026 11:49:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding: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=1775404157; x=1775490557; bh=ikRfAbRLZNRWSSyboJKUcA/9CKso8Q/PjNn+7evtB0c=; b= fypIRSzPaG0cAZZG1xuj8x9gAM/7b6Jk8FfC+JTyOxr0uFMGVFC/HuHzqNQgReyA tr/FBjxeDkkKwl7rsQ6FuSUSvh7DIolv5GGYu+cSP6uz5+tJz4r6ZFEDFePZODj3 ithjq+qHQPaychxcytEbRxSpfuo5ap6wOmWphoqfT27qFzMlOAh1KV/AiPqFRIfw XDRDTfo3eJP9mOmoicEaNk3vHUR718sNTky828MaRIL3SbCDML8hbs9HbSGTLlpY 9axnUY3069JuHcFYwc23wL8Nlm/C8oKrKxGVI0ZPc1VhqtujSMROYKyGMZ4Qz2M7 qTxqJvrJPxo+n1vV01d2AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1775404157; x= 1775490557; bh=ikRfAbRLZNRWSSyboJKUcA/9CKso8Q/PjNn+7evtB0c=; b=u 4IOJ9AXcPm1+J3R1Godxadf5UvHeqG3T0CHmJEWv8zQfj7A64VC80gmmBVhqkCSQ jjZnsnI38bpXmEeMBxKmEZII4VEvz3uj2dPrSsLOUkLbR+VgANojV16Pji9m0x7l dMu1LMG/F7b+vJzOpN6Tr0OES0NhXC5bBwpLnrDVFFNi2aD8k0RAWeWNR4AD/bej NCzZ1C//iXT0tiTNWBDVBJCs3Kx8Z2BZLGTXeyEeuMHvpoMczGvyjpFSEjUgPHf8 HaWvsxGgKzMXWrRURqwz4GNfAncVsQUOvHK9/eym2s7BkTO4ntBEsQb/IuDhu5T/ 29giJIu6XuQQdmLhs7bNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduhedujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgestheksfdttddtjeenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnheptdelledvgfejvdffieeukeefueelfffhgeffhffgffekveeuheeihefhiefg hfdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeduuddpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepughgrhhofihlvgihmhhlsehgmhgrihhlrdgtoh hmpdhrtghpthhtohepvgigtghluhhsihhonhesghhmrghilhdrtghomhdprhgtphhtthho pehlihdrvghvrghnrdgthhgrohesghhmrghilhdrtghomhdprhgtphhtthhopehmvghlrg hnihgvphhlrghgvghmrghnsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhgvshhhkhgv khhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhhosggvrhhtmhhhrggrsh esghhmrghilhdrtghomhdprhgtphhtthhopeiguhhnvghnghiihhhouhesghhmrghilhdr tghomhdprhgtphhtthhopehhlhhinhhnrghkrgesihhkihdrfhhipdhrtghpthhtohepph hgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Apr 2026 11:49:16 -0400 (EDT) Date: Sun, 5 Apr 2026 11:49:15 -0400 From: Andres Freund To: Melanie Plageman Cc: Alexander Lakhin , Tomas Vondra , David Rowley , Kirill Reshke , Chao Li , Andrey Borodin , Xuneng Zhou , Robert Haas , PostgreSQL Hackers , Heikki Linnakangas Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) Message-ID: References: <2be31f17-5405-4de9-8d73-90ebc322f7d8@vondra.me> <97529f5a-ec10-46b1-ab50-4653126c6889@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-05 11:42:19 -0400, Melanie Plageman wrote: > On Fri, Apr 3, 2026 at 1:00 AM Alexander Lakhin wrote: > > > > I've come across an interesting failure produced starting from 378a21618: > > when using a build made with CFLAGS="-DRELCACHE_FORCE_RELEASE" and > > echo "io_method = sync" >/tmp/temp.config, the test run: > > TEMP_CONFIG=/tmp/temp.config TESTS=temp make -s check-tests > > > > fails as below: > > --- .../src/test/regress/expected/temp.out 2026-02-13 06:15:55.887368624 +0200 > > +++ .../src/test/regress/results/temp.out 2026-04-03 07:51:36.735504156 +0300 > > @@ -493,11 +493,7 @@ > > > > -- Check that read streams deal with lower number of pins available > > SELECT count(*), max(a) max_a, min(a) min_a, max(cnt) max_cnt FROM test_temp; > > - count | max_a | min_a | max_cnt > > --------+-------+-------+--------- > > - 10000 | 10000 | 1 | 0 > > -(1 row) > > - > > +ERROR: no empty local buffer available > > ROLLBACK; > > It has to do with the query needing an additional pin for the VM > during on-access pruning and the read stream reading ahead until there > is only one remaining buffer pin in the local pin limit (the cursor > above is already consuming much of the backend local pin limit). We > could perhaps fix this test by decreasing the pages in the relation or > increasing the backend local pin limit, but I wonder if we need to do > something more invasive to ensure that we can pin at least two > buffers. I think we should probably just have GetLocalPinLimit() return something considerably smaller than num_temp_buffers, e.g. num_temp_buffers / 4 or so. There always may be more than one scan going on, so we can't ever promise that there's at least a certain number of pins available. The main goal of the shared pin limit is to prevent one backend from pinning disproportionally much of s_b. And for that eventually scaling down to just needing 1-2 pins per scan is sufficient. Greetings, Andres Freund