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 1vprOd-000EId-02 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Feb 2026 17:19:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vprNd-0005BZ-11 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Feb 2026 17:18:30 +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 1vprNc-0005BI-0y for pgsql-hackers@lists.postgresql.org; Tue, 10 Feb 2026 17:18:29 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vpqvp-000000000cb-3bWk for pgsql-hackers@postgresql.org; Tue, 10 Feb 2026 16:49:49 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 13AE17A014A; Tue, 10 Feb 2026 11:49:43 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 10 Feb 2026 11:49:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; 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=fm3; t=1770742182; x=1770828582; bh=ckMTrysEd/ VtF8KurToTK/s/elwWl55eEKGsI97AJis=; b=nQlroaRS2DwrmyTbb69lXLImyL 3xhW4oxIkxAbSyDtefTC6z+BxYMdjBu2G6nkTsbCHOEFWHBFf6Besh9NsLWagPId 95qnT8yjZ112GgfuPhbokfPj/ZE2pdIUAsLkzh+iL3+EJnv9tTE2kG6VpIzsgY+Z hrA3dumP+DPate0eETuJS4ZILFN34r+nVdFhoJ7mDpBqJQg/lyGx2RBohbSHmI2+ LHlJzlL4ky7N0YLfKkMC/uocE8YRj5pvD9G5oK8TAfN7aGKVSlrNR/p+l6G/8Wr+ yjWm+/z68m9PyhVUoJk+O/sjsK1T/cDn9CiVSdQ3jbF85wlaRbejtNc65bWQ== 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=fm3; t= 1770742182; x=1770828582; bh=ckMTrysEd/VtF8KurToTK/s/elwWl55eEKG sI97AJis=; b=umq8H/4ZSKL3ObFvuOLNBSfBTIyTO2pOHRXStzRtRNU9wQG5Nqo I8CTv4iIKXmRW31Hw6RHtJv4VKavlAGj1PKfSGGX8Hr1zPWfGymgMFxbc9fRyqym 8HuDCMdLZfhGMv4ZpwJ/FF+2DpTBCQoQ33B7J2DZqPujfeRlRMRpYLsmswku0UMB mzANeNBKnFJIU2UQ+m090iaaunh4NYk8ST1OYQIkcJTJToQT+WzzugUc0OB1Au1/ zrmf5mhY8zyDkIDbO9ifKcM1GWyP/OzBM+ORzaxbcL20CMEhSTktrQ+MYUqRP1jw qsO77+cVswSDbjguAPAYTjx4OepF3Aiavbw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvtddtvddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetveduieet tddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopedutddpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtoheprghhsegthigsvghrthgvtgdrrghtpdhrtghpth htohepsghovghkvgifuhhrmhdophhoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghp thhtohepmhgvlhgrnhhivghplhgrghgvmhgrnhesghhmrghilhdrtghomhdprhgtphhtth hopehmihgthhgrvghlrdhprghquhhivghrsehgmhgrihhlrdgtohhmpdhrtghpthhtohep rhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhhosggvrh htmhhhrggrshesghhmrghilhdrtghomhdprhgtphhtthhopehthhhomhgrshdrmhhunhhr ohesghhmrghilhdrtghomhdprhgtphhtthhopehhlhhinhhnrghkrgesihhkihdrfhhipd hrtghpthhtohepnhhorghhsehlvggruggsohgrthdrtghomh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 10 Feb 2026 11:49:41 -0500 (EST) Date: Tue, 10 Feb 2026 11:49:36 -0500 From: Andres Freund To: Antonin Houska Cc: Kirill Reshke , Heikki Linnakangas , Melanie Plageman , Matthias van de Meent , pgsql-hackers@postgresql.org, Thomas Munro , Noah Misch , Robert Haas , Michael Paquier Subject: Re: Buffer locking is special (hints, checksums, AIO writes) Message-ID: References: <1108f18d-cf7c-4f17-b29c-a119fe42f7e5@iki.fi> <5dwlfu2jyzkyf3nrlzxxblxctb6xio5es73ptgsahjnmfu5miu@772rc764hfhi> <4csodkvvfbfloxxjlkgsnl2lgfv2mtzdl7phqzd4jxjadxm4o5@usw7feyb5bzf> <61812.1770637345@localhost> <19720.1770709587@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19720.1770709587@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-02-10 08:46:27 +0100, Antonin Houska wrote: > Andres Freund wrote: > > I think we ought to instead restrict the page-at-a-time scans to only happen > > with "real" mvcc snapshots. I.e. this: > > > > /* > > * Disable page-at-a-time mode if it's not a MVCC-safe snapshot. > > */ > > if (!(snapshot && IsMVCCSnapshot(snapshot))) > > scan->rs_base.rs_flags &= ~SO_ALLOW_PAGEMODE; > > > > should trigger for historic snapshots as well. > > I suppose you mean changing it to > > if (!(snapshot && IsMVCCSnapshot(snapshot) && > !IsHistoricMVCCSnapshot(snapshot))) > scan->rs_base.rs_flags &= ~SO_ALLOW_PAGEMODE; Yes. For something committable, I think we should probably split IsMVCCSnapshot into IsMVCCSnapshot(), just accepting SNAPSHOT_MVCC, and IsMVCCLikeSnapshot() accepting both SNAPSHOT_MVCC and SNAPSHOT_HISTORIC_MVCC. And then go through all the existing callers of IsMVCCSnapshot() - only about half should stay as-is, I think. > > Does that fix the issue for you? > > Yes, with this change, I don't hit the problem anymore. Great! Greetings, Andres Freund