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 1w9PcY-001Pek-0A for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2026 15:42:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9PcV-003esM-1m for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2026 15:42:39 +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 1w9PcV-003esE-0f for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2026 15:42:39 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9PcT-00000000kQ5-0y9r for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2026 15:42:39 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-66ee071fe35so352905a12.3 for ; Sun, 05 Apr 2026 08:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775403751; cv=none; d=google.com; s=arc-20240605; b=huxgsdm0JJbHIOe5FPZmyUZGIpnIOxEv88POr8uslU7/tS3Hdy0OoWs0lmKnXmRJyg SA3HFd9InG5MEn11OdQiqy967Eetcxd9FJZ4Lj5RSaYbQ2jLOimIvniuLposM5dHUIAZ H5MEGHRfDDCXsLvMbVBVnJHo0aDrhqrvdEfm+0zEjYmA6LFqYIxFHqNfs5svxM+ydrKu BUcSj9I3bBia59/TZch4+zsxz4Y5gP+hkGVeA/7Mn5lP3rq2UANK/XX29Kq73Cbx4ggQ +Cw40Ja5qZSvsCWd/kJ12VyEKoiHPbpGw8CHtA+wCyhNSUKrgWgqPiYG6GBLqP8w4mnZ yZ+Q== 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=kwQrSJSclQHD9ls6ypXP4y43Uhu6+Cjmdl2CmLna43Q=; fh=zwmB76BcTIt2GVLzXbJKcLpWjJIR7pKgPsUOJGSHzDE=; b=ZA5MTIrX8SfWmHiZndhNJNoIRhwR/9p/bcKl1d1gLcEhnYfHl4AXlybsImPRXft20c xwc+YYAyNleI+W3cQK2bqHXDmEvzPYstXzKBngVZrWxbVoGa2GYd1q5DaNgSSNSTRFY8 iRRgtrCiT3r3sXE5pPiYXF7Yw2b4ivjvJO8xVqq/jlkzT3dCDRRQqGOerTdsU6HF8sTc SOQBRXwGJ3a78V++eUvDhB/LLShostXawSEB/v7yp9sIiDno8MkJrcrEZG0Ft4cNoXrW 0G/YjWIauwPSCSemnLEhWXhsjk8jDBcCNqqST5Qu65wkzVsd8VgkTF06zfO+UFnWCkCp 2NNA==; 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=1775403751; x=1776008551; 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=kwQrSJSclQHD9ls6ypXP4y43Uhu6+Cjmdl2CmLna43Q=; b=gyDQiV2EdJLel7gIb/o2QGdxf5WsTS5uwb751zZInJ3YIP493AEm5U1iGNwD8KWbpp GDzNB3Q+W54CKZCoNfZFI/SVOKacsHW/uUflG8P88G72X71HtbhCViYn4hnH+k6kjIPN VGIOr6fVvMBrUaBogWVv85CUH8T9a0FrSCbC9R1XHSKkoUHgyc+wzwwun0B78FzxwajK 7+vfK6hiGf8+N4g1G2dOi60z7m2ow9teUi1JCDqeBAqc9pPCIue53uxbZoARpnjFhWl3 rFk+ytvGkZH7hr5ExtTgKb2e5fjbRQU68hOFSFpMGwI3ob9aLvoPR27833qG6LOMxtiu /CkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775403751; x=1776008551; 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=kwQrSJSclQHD9ls6ypXP4y43Uhu6+Cjmdl2CmLna43Q=; b=GTewq8pz/Eaj+E3+lme7xlQ4Cc1plr6tFMyCnHILL3xnvQFnpf1QO0kmPEfcc6oTf9 cw3tcbpYpy82ahvAj04YOZaJPD+Fbz7KuFIzrJI2+RE6MUgXtt1wzkZ9PujpcgwR2Qtj 8OZ7uGmGxLtKcFDKpOhAQbeQoSy1wyOrHV2meLzNpPTimFg73rz5bhtMUkxib0xHDbsO EcE6Uii53FhV9LAruhS+rCgiZlJ5fBSM57/FLglFnOhd3MFVQ/nThLiYjRD+BZoUvDoh k/BL4RH+e/7JmJtrHJm+52KQv6cLXKN1rvCaTq2BcglES4nQPlxEVYnb4ZaM/BJ681gR VnzA== X-Forwarded-Encrypted: i=1; AJvYcCVLYdXDIp+frSCtdas+NPkRp7fjZ5Fjhj0D9FIwT2VE9LB5Nk9/XzV8ySrf0R6Xmxeed7zfyvFWerHN2cu7@lists.postgresql.org X-Gm-Message-State: AOJu0YyaOLInyMFiTJdEYlRnkNQq+LUYnhiGQZkResuONtP48z678p76 P6Ki2ZveQqxNzD+puFLWTrwVcDThxpwpe1E8YCDs6k2xHRshCJRv7L9IINzOAZmeHwdr5wWd8mg Z9aFL/0Ol08IU0mt9HzRLFG6PjQqK0K0= X-Gm-Gg: AeBDietPOOx5ZI25TrFkKJubA1nMrKyNA68F9MZTYy+GrJFmNZeRan6gBgEdfPmni6j roBuisTHb2gYN+EjdoGsy0eV9fzAC3QrL0Gdhrd8KrTar+ozEv8qzTiX+zXezNpADtHdn55fdUM CF75+jwnNaBPX/zDvfEQR9sGUe8tQmfFBPutMZ8vArQL4YfR0T1udO+fMmFnD9nIs1i9JILo0Du tu/wrjVSXCQWtlzTau5LsKuhuvOwXHYFipckyZGrQbdiMpSyrJwPA9+uFECjKUYY6OO+VfgYxbB ifBpPemQerlf5/tN5flYu2u55y2y7YBboo28gdY8OGqvwWDv9SC84fq6ztlnHi9J/7/QK40MaQS b+Kc7bSBJ X-Received: by 2002:a05:6402:24c2:b0:66e:44d2:6c3e with SMTP id 4fb4d7f45d1cf-66e44d27f31mr3111401a12.2.1775403751050; Sun, 05 Apr 2026 08:42:31 -0700 (PDT) MIME-Version: 1.0 References: <2be31f17-5405-4de9-8d73-90ebc322f7d8@vondra.me> <97529f5a-ec10-46b1-ab50-4653126c6889@gmail.com> In-Reply-To: <97529f5a-ec10-46b1-ab50-4653126c6889@gmail.com> From: Melanie Plageman Date: Sun, 5 Apr 2026 11:42:19 -0400 X-Gm-Features: AQROBzAoxDHCxC1Ue3d0DTcKl0sUcZiv6GpRwLd-IJw7TkVY-AZpkdqSuLiTKPM Message-ID: Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) To: Alexander Lakhin Cc: Andres Freund , Tomas Vondra , David Rowley , Kirill Reshke , Chao Li , Andrey Borodin , Xuneng Zhou , Robert Haas , PostgreSQL Hackers , 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 Fri, Apr 3, 2026 at 1:00=E2=80=AFAM Alexander Lakhin wrote: > > I've come across an interesting failure produced starting from 378a21618: > when using a build made with CFLAGS=3D"-DRELCACHE_FORCE_RELEASE" and > echo "io_method =3D sync" >/tmp/temp.config, the test run: > TEMP_CONFIG=3D/tmp/temp.config TESTS=3Dtemp make -s check-tests > > fails as below: > --- .../src/test/regress/expected/temp.out 2026-02-13 06:15:55.88736862= 4 +0200 > +++ .../src/test/regress/results/temp.out 2026-04-03 07:51:36.73550415= 6 +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. FWIW, I don't think this can be hit with the FSM, because we release the heap buffer pin before pinning it. Though perhaps there are other places in the code where scanning a single buffer with the read stream entails pinning at least one other buffer. - Melanie