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 1wls6f-000QsI-2N for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jul 2026 17:48:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wls6e-004ND1-0k for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jul 2026 17:48:43 +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 1wls6d-004NCt-2w for pgsql-hackers@lists.postgresql.org; Mon, 20 Jul 2026 17:48:43 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wls6b-00000000JCH-139K for pgsql-hackers@postgresql.org; Mon, 20 Jul 2026 17:48:43 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-49548e01d02so15522725e9.0 for ; Mon, 20 Jul 2026 10:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1784569719; x=1785174519; darn=postgresql.org; h=message-id:date:content-transfer-encoding:content-type:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to:content-type; bh=44xJVvKAjWHoEie58HLgJeJUMqeY3O/aTYlqeCSclG8=; b=p7QjQLb9D2Ll1NHK59m0petpyFaHFcnLiXv2Y35BTXSP37N9Du8+VALslU2BqRmX7v AfwbLt43H8BTS6qTwCT9SAQyIuMDVQRuuxfXD6J4y3wFyEqUApq9E0wvS416ONIz2G+n u5dV/+rdNfEYs8ZyL/WZCVHb/+0eLI7EHCURwekraIZ+hfP8Ot6jOWCwKrjfEEBLOOFH x8b1UmDPBqKWLePwRhT8s1I802g3iPtCikpWjAbxWFTIZaRyLw99YVN9u9N8DlKrx/Hh KEBLRHkwE8zFFbUxFNN8WiGafzFu3CJdEYuzVWDxGoOR+oxk+c+mYhvmRxAZq9nrYjVX VQFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784569719; x=1785174519; h=message-id:date:content-transfer-encoding:content-type:mime-version :comments:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=44xJVvKAjWHoEie58HLgJeJUMqeY3O/aTYlqeCSclG8=; b=IyXdFGbc88vZ2QC5Ykw16N5A0nur2VO9waEVvGC8N0mNlO/PCbFD1BoxPhigIJurp7 iPZBzA4KhWw79HOniIBUFZnmGWbTccHsZx5Rp+AR/x/5NjqRlXJcObVfR9raPURYnDYt kRID+BwzA1kl7NkwSDmk8M1ZuVxOkco2XdVpSlZm1I7JIdWVbrLirrMg28FwusBYmLs+ iHaaYUTVIfREea8BiI2J0meAVuuZVS6bgSI/LZ/j0OWEM8kwUQxuwGzdSIThr+sMwdpB J8vwkEVejKnEqDedmvUciZLnBSuN+96ob/wjPLlkzB+hOhs+SwApyehOiB1gupaZxqPd o2Gw== X-Forwarded-Encrypted: i=1; AHgh+Rr8TlNlQWeV2LZAodSmNsGuTX8Sx00sjr5wAdkOyieuYlLBHV4qgskPHHMV+OrJ8AwtCVnPBRxCF4zYexOm@postgresql.org X-Gm-Message-State: AOJu0YylGua7Z7XMw+SAjPujPqNK1mlZwmpuaqJqv+ZuirWVi9sq+6vA hihWx+bKG8+o9eaud7j/hTCCW9ymZlZ4CU1rFju6FAdbByB0yYfrkJwQcVt1ydyXJXc= X-Gm-Gg: AfdE7ckOkAl23Y6gXMDnNKf+CNA8OX/spfuMoQaACLWjyGyVvempYEyyxb2skyADGid V2hAcyuKJbZgDSdVCrsvoqr2hneWBrFu8bbz+UbpktmSoTyB3t/jeNujuLfr1Wj5715O2YTx5my UeT7lZGKxc885GxDE4f1CPnB9UvmEUBMzqujJKaz63EFGfhDKd8X3DC7mp/3/3ewh9FzND98dUI iw5C+D4i5yu2HLU+Sdo5ABjoAaSq6KrNP5X0fa5SXPPrBMT/eN8zaXPPAQwBPUu0RQpTijdnz0l Lfh7wShuuFoS59ZqaSfaK1MyMlLloWuMlRtD6Mex3HCXyjR7mw0GjnxFy/BY44DP1478st0lyAa LKbHsspz3kKw6t7Od4OtAnWQooSGvXv21D4ACgX+3cwqgcABnk9AxhDSImO+kwhHFH/h3WLp2Gx XjHTPuSQiHcVYJYv4= X-Received: by 2002:a05:600c:e54a:20b0:495:5d6d:9cd5 with SMTP id 5b1f17b1804b1-4955d6d9e31mr47164715e9.27.1784569718759; Mon, 20 Jul 2026 10:48:38 -0700 (PDT) Received: from localhost (109-81-170-190.rct.o2.cz. [109.81.170.190]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-495653687b2sm8036555e9.1.2026.07.20.10.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 10:48:38 -0700 (PDT) From: Antonin Houska To: Michael Paquier cc: Alexander Lakhin , Matthias van de Meent , pgsql-hackers Subject: Re: Unexpected behavior after OOM errors In-reply-to: References: <95c64dc2-3abe-4f4e-b285-4c681f565d9f@gmail.com> Comments: In-reply-to Michael Paquier message dated "Sat, 18 Jul 2026 16:49:49 +0900." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 20 Jul 2026 19:48:37 +0200 Message-ID: <91199.1784569717@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier wrote: > On Fri, Jul 17, 2026 at 12:00:01PM +0300, Alexander Lakhin wrote: > > 4) make_new_heap(): > > --- a/src/backend/commands/repack.c > > +++ b/src/backend/commands/repack.c > > @@ -1255,3 +1255,5 @@ make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, = Oid NewAccessMethod, > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > > +oom_prob =3D 0.01; > > =C2=A0=C2=A0=C2=A0=C2=A0 CommandCounterIncrement(); > > +oom_prob =3D 0; > >=20 > > triggers: > > TRAP: failed Assert("ItemIdIsNormal(lp)"), File: "heapam.c", Line: 2813= , PID: 943626 > > also: > > ERROR:=C2=A0 attempted to delete invisible tuple >=20 > I'll let Alvaro comment on this one. It deserves an open item. I was also curious because I worked on repack.c recently. After applying (a bit rebased) random-oom-errors.patch from [1] and after turning some "out of memory" errors to PANIC, I could reproduce the error even on PG 18. The sta= ck trace is below. So it does not seem to be PG 19 specific. #3 0x0000000000c1837a in errfinish (filename=3D0xee1d80 "mcxt.c", lineno= =3D1164, funcname=3D0xee24a0 <__func__.6> "MemoryContextAllocationFailure")= at elog.c:600 #4 0x0000000000c58e0c in MemoryContextAllocationFailure (context=3D0x2fb3a= 60, size=3D344, flags=3D0) at mcxt.c:1164 #5 0x0000000000c4bc1e in AllocSetAlloc (context=3D0x2fb3a60, size=3D344, f= lags=3D0) at aset.c:983 #6 0x0000000000c59504 in palloc0 (size=3D344) at mcxt.c:1388 #7 0x00000000007898a8 in MakeTupleTableSlot (tupleDesc=3D0x7f3eef0aa228, t= ts_ops=3D0xdfddc0 ) at execTuples.c:1321 #8 0x0000000000789b76 in MakeSingleTupleTableSlot (tupdesc=3D0x7f3eef0aa22= 8, tts_ops=3D0xdfddc0 ) at execTuples.c:1430 #9 0x00000000005712a0 in table_slot_create (relation=3D0x7f3eef0a9f08, reg= list=3D0x0) at tableam.c:98 #10 0x000000000052a812 in systable_beginscan (heapRelation=3D0x7f3eef0a9f08= , indexId=3D2659, indexOK=3Dtrue, snapshot=3D0x0, nkeys=3D2, key=3D0x7fffa5= 230e00) at genam.c:408 #11 0x0000000000c028dc in RelationBuildTupleDesc (relation=3D0x7f3eef091378= ) at relcache.c:564 #12 0x0000000000c03ad5 in RelationBuildDesc (targetRelId=3D32768, insertIt= =3Dfalse) at relcache.c:1206 #13 0x0000000000c05ffa in RelationRebuildRelation (relation=3D0x7f3eef08f1b= 8) at relcache.c:2661 #14 0x0000000000c06671 in RelationFlushRelation (relation=3D0x7f3eef08f1b8)= at relcache.c:2847 #15 0x0000000000c06864 in RelationCacheInvalidateEntry (relationId=3D32768)= at relcache.c:2949 #16 0x0000000000bf6f7b in LocalExecuteInvalidationMessage (msg=3D0x30898d0)= at inval.c:856 #17 0x0000000000bf6908 in ProcessInvalidationMessages (group=3D0x30895d0, f= unc=3D0xbf6e6f ) at inval.c:578 #18 0x0000000000bf7ac4 in CommandEndInvalidationMessages () at inval.c:1419 #19 0x000000000058b462 in AtCCI_LocalCache () at xact.c:1591 #20 0x000000000058adef in CommandCounterIncrement () at xact.c:1139 #21 0x0000000000699f03 in make_new_heap (OIDOldHeap=3D16384, NewTableSpace= =3D0, NewAccessMethod=3D2, relpersistence=3D112 'p', lockmode=3D0) at clust= er.c:788 #22 0x0000000000699bca in rebuild_relation (OldHeap=3D0x7f3eef08e998, index= =3D0x7f3eef08ec88, verbose=3Dfalse) at cluster.c:659 #23 0x0000000000699624 in cluster_rel (OldHeap=3D0x7f3eef08e998, indexOid= =3D16388, params=3D0x7fffa52314d4) at cluster.c:472 [1] https://www.postgresql.org/message-id/95c64dc2-3abe-4f4e-b285-4c681f565= d9f%40gmail.com --=20 Antonin Houska Web: https://www.cybertec-postgresql.com