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 1w2bMl-000Qw2-15 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 20:50:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2bMk-005220-0k for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 20:50:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2bMj-005214-34 for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 20:50:13 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w2bMg-00000000FSY-0Jwy for pgsql-hackers@postgresql.org; Tue, 17 Mar 2026 20:50:13 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 0D5411400103; Tue, 17 Mar 2026 16:50:11 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 17 Mar 2026 16:50:11 -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=fm1; t=1773780611; x=1773867011; bh=WYg7VFF7ZpIt6q+Na2RrF3gSxjpCDypZXYLJDjk9Kb4=; b= pRLHRExTZh+FgT554qE/psUgm5ru8/XnmqxV1F+j5C34yf6OUyyrJtCnQGmkgBWd i3E6XA9lCFSXZ8JqklkWU3WpO8fflZw4TqNmIcwpqU5jy/gu9zwqNaDX7dYFDwRW v6GezpW4xWMvPFbAflJCtnsv5qlZ8qEJiTMKL3EvK1tvoMKKYwMPouv69TkPAGAt BrzpApDW3W5+3OPT+0tya38p9p5xpYPLhBdxB2ciiYLbqEWUma3oa/o530cI5STZ IOZvhBd4oVseQZt+ciWAUcf+PX6V5AedT7DRG5OiL6Rcs62XGB9r29RCvVhemaTc M9IVJw+7wRd6vwoc0qjpzg== 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=fm1; t=1773780611; x= 1773867011; bh=WYg7VFF7ZpIt6q+Na2RrF3gSxjpCDypZXYLJDjk9Kb4=; b=B EzMVink9A9cJlym4Fdvkm39hvfSmdfdukghjgesvtNOkViDogRXHRDxR7gxwxukM tzkssFyxZgsC26dnu9wdVi1ovf1+jGEmdCwdROTt8GrRhdauMuut6o8q08Gz4xrh ak9Ond8jy98kr99P+T/c9shb3U/VdQ+l+GJCCE3IomhnkSO4bPVod32QrgSCvZNg qYudsYCV+5lIxsem8QOKbxBhI372Gms2tC5t9cVD2Nc0mJMK2PnT3MwkdWF4ahAa 0AaE85eTIstPgDIxgQdHI03qfdDMqVnv0aHJjZpFSkX5kECs+jT5iDp6IplsL7Fz fD4BWOld2vLuzS75PelqA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeftddvvdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggugfgjsehtkefstddttddunecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpeehvdefffdujeevlefgheekueeuueevgfethfeivdffkeeufeehueeufeei teeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepuddupdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopegsohgvkhgvfihurhhmodhpohhsthhgrhgvsh esghhmrghilhdrtghomhdprhgtphhtthhopegvgigtlhhushhiohhnsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepmhgvlhgrnhhivghplhgrghgvmhgrnhesghhmrghilhdrtghomh dprhgtphhtthhopehmihgthhgrvghlrdhprghquhhivghrsehgmhgrihhlrdgtohhmpdhr tghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtoh eprhhosggvrhhtmhhhrggrshesghhmrghilhdrtghomhdprhgtphhtthhopehthhhomhgr shdrmhhunhhrohesghhmrghilhdrtghomhdprhgtphhtthhopehhlhhinhhnrghkrgesih hkihdrfhhipdhrtghpthhtohepnhhorghhsehlvggruggsohgrthdrtghomh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Mar 2026 16:50:10 -0400 (EDT) Date: Tue, 17 Mar 2026 16:50:09 -0400 From: Andres Freund To: Alexander Lakhin , Alexander Kuzmenkov Cc: Noah Misch , Heikki Linnakangas , Melanie Plageman , Kirill Reshke , Matthias van de Meent , pgsql-hackers@postgresql.org, Thomas Munro , Robert Haas , Michael Paquier Subject: Re: Buffer locking is special (hints, checksums, AIO writes) Message-ID: References: <5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d> <68e89de8-5f6c-4eaf-a800-e16a5e487667@iki.fi> <20260215195239.ce.noahmisch@microsoft.com> <52d064b8-63bd-45df-a405-b6017d49b300@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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-03-13 11:55:53 -0400, Andres Freund wrote: > On 2026-03-13 10:00:00 +0200, Alexander Lakhin wrote: > > Hello Andres, > > > > 12.03.2026 00:40, Andres Freund wrote: > > > I pushed this and many of the later patches in the series. Here are updated > > > versions of the remaining changes. The last two previously were one commit > > > with "WIP" in the title. The first one has, I think, not had a lot of review - > > > but it's also not a complicated change. > > > > I've discovered that starting from 82467f627, the following query: > > SET cpu_operator_cost = 1000; > > CREATE TABLE t (i INT); > > INSERT INTO T SELECT 1 FROM generate_series(1, 1000) a; > > CREATE INDEX hi on t USING HASH (i); > > DELETE FROM t WHERE i = 1; > > DELETE FROM t WHERE i = 1; > > > > triggers > > TRAP: failed Assert("BufferIsValid(buffer)"), File: "bufmgr.c", Line: 497, PID: 3942058 > > > > #4  0x000079a60ae288ff in __GI_abort () at ./stdlib/abort.c:79 > > #5  0x00005a68d9343eef in ExceptionalCondition (conditionName=conditionName@entry=0x5a68d93ac27d "BufferIsValid(buffer)", > >     fileName=fileName@entry=0x5a68d93c99ef "bufmgr.c", lineNumber=lineNumber@entry=497) at assert.c:65 > > #6  0x00005a68d91a18eb in GetPrivateRefCountEntry (do_move=true, buffer=) at bufmgr.c:497 > > #7  SharedBufferBeginSetHintBits (lockstate=, buf_hdr=0x79e5febbbc40, buffer=) > >     at bufmgr.c:6830 > > #8  BufferBeginSetHintBits (buffer=) at bufmgr.c:6931 > > #9  0x00005a68d8e3c862 in _hash_kill_items (scan=) at hashutil.c:603 > > #10 0x00005a68d8e3b7c3 in _hash_next (scan=0x5a68e735f938, dir=) at hashsearch.c:69 > > #11 0x00005a68d8e616ce in index_getnext_tid (scan=scan@entry=0x5a68e735f938, direction=direction@entry=ForwardScanDirection) > >     at indexam.c:647 > > ... > > #25 0x00005a68d91eb4ad in exec_simple_query (query_string=0x5a68e7270120 "DELETE FROM t WHERE i = 1;") at postgres.c:1277 > > ... > > > > Could you please look at this? > > Yea, it's a stupid small mistake. Alexander Kuzmenkov reported it late > afternoon yesterday, privately as I just noticed, and I was too tired to make > sure an added test wouldn't have stability issues. > > Will fix in the next few hours. Took longer, sorry. But it's pushed now. Greetings, Andres Freund