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.98.2) (envelope-from ) id 1xLUDL-00000001XWv-3orB for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Oct 2026 23:34:52 +0000 Received: from localhost ([127.0.0.1]:46326 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xLUDL-00000008RMc-1Ar9 for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Oct 2026 23:34:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:33168) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xLUDK-00000008RM0-1Mnt for pgsql-bugs@lists.postgresql.org; Mon, 26 Oct 2026 23:34:51 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xLUDI-0000000160E-2OiZ for pgsql-bugs@lists.postgresql.org; Mon, 26 Oct 2026 23:34:49 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 95F177A041A for ; Mon, 26 Oct 2026 19:34:47 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 26 Oct 2026 19:34:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=fm2; t=1793057686; x=1793144086; bh=INp9F59CSf e82F1YhuRxqNPOYXOs3JSJHUS7WejLYGE=; b=rsBRKlRiCDwxyfJ+FPlwOT9jaG sgO+qMTO1dPlfFLKKkvgVmDRyZoLn5YGcUIU49Y9W/MYB3NATA0MfwqnUkJL5ysI VTEc9NlT7K0a8PoHiKC3Z5NX3GIRN+SKNbVMDUykOAa6mhmAi7p2I/Iw71P6dK1V BESnHxqBKL/SWhAsh9Ivw5ucolWUq6AOKS/kLvRdDDSWMKFZx6Ta05lkDErp9Dpf C6omG5IZX771MfjskQbb2FUckyVaOuPP5Wp0GvQgqQ56T8E9UfGjPuRF/CenKZdc mWS8gyNsD89T7lMvH60HBtkpcgPXgEPLMiua9SQbrJZpWHmVhrgyKTjFdAig== 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=fm2; t= 1793057686; x=1793144086; bh=INp9F59CSfe82F1YhuRxqNPOYXOs3JSJHUS 7WejLYGE=; b=mBrmpUHAnB60VivqZ1K464MSrd5OgHWN8BwBqN6n4aEo9KbOJdG 9I/xON75rRDQa3N7Lx3z6n5kawXK2zBS0MmCYCOVRT+5VVfWpp+4n+A38Y0BZeU9 3vU/JmFCzxndPt4KnX0ZDvb8j0BCfKGQo14kUYIDEuO1L5Mgbymj8wGugVyEBdYm hgb+N+WOMs/lFwzxWoqFpDeFq/CmIH9Pt06hBBA9TrU+KKEHktYPjaGiB1TOJ1bE 4YZNEkG0CK0ODhfUmjogaQknUMooAn0DjmW6d/XTS6xP5aCHkKOH/t2kfIViCFGM /6AKd6IqYgGVTbXlvHbhpMk64LveT9RxYcA== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-07; repo=github.com/dkim2wg/interop; date=2026-10-18; sw=lmtpprox; action=sign d=paquier.xyz a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1793057686; d=paquier.xyz; mf=PG1pY2hhZWxAcGFxdWllci54eXo+; rt=PHBnc3FsLWJ1Z3NAbGlzdHMucG9zdGdyZXNxbC5vcmc+; s=fm2:rsa-sha256:LHe17/OhCcsis9jW3Z5+LmBG4rW1z3p9vhALPXmdYOMv+BU AAtQ8hMTekF8mx2lrsqcJ3jGJCUJtU4lvTb1X+dVE9yr136Ilg4v/jttf7DtTC4J dYiO68worHRLEitQoMW0S/Qiha9YmG3JC1qLIVEHlmZ4oB2jq5xIJguARCoZkaG+ g8hztMFq2Jy4/Gzvc3g5U6nbx+FSWZt2Hon5uLbcLNzHdSeXmP8wRBWO28FTX2dP P3Gy8VCPaSTXRnT8oQaFEhUsU6HjReGeFaYt9dyGPk9Q4m9NWRM/S7KqkUoA5rBA TeiZ+Z1fMB1kWw1ipOjJPr6uurxpMS29YR/XZ0w==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-07; repo=github.com/dkim2wg/interop; date=2026-10-18; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:fLnNYfbUT9CAdXOn0oPzyqitBJo0AB1ypmxtoDVqSek=:/iGx1T+GqOn82tb6+BpgV7YmMNIFUriev++Z2Xq76zQ=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEEgvDyAu2amcNvuH+aOXWWf14Q6BYKqLXkk49U3nHGH3g24n21mhPh/+q6ao3RlL wXa233uqB4gyxM+4ZONd5I9jUmEYnGaPDw+mXsQpSzYrtXcZOsZwbdmhwruBDlkBTMvdoV fGPffd+0ws3Z9s63XUaUnd3U3m7l7vwt7NsAn7AdUTnFDd6Tmf4vtkA1zwuNsQpn0xV3hZ 3Z3uymOhreWzS2yaJf6erKj20Qb+JaldrFpSqa+v32VCSy0Ag1eVY0mK2q20K7JaiivPGb GR2TrMg395ALOFxvg+mdq9j+445jBCr7iBaL2QTKpyLcgBHnAByid81yKy58nlXyOJgKK0 tplb5qWGELBtutnEffUQShLnFhfSguWqY0vWdfe3fqO/2O100skgnXhrnZVzJwS9gegN4/ k2Iqw9BU2O/Xo+o+B73QnPnlL5YAqCmwdbedme2bQttfwnk/yhiobnommfA8gWBR973SEg qpo3tPLmSmZLKr1MIhCF98uRbq5LWVsoKr48eAUVf+WaPpSlINDBuldUb1RaDcNvrrQcQm iN1l6vUS2xdI2kmDR0IdcHKQ2siEJUauQhklVSX+cvPzSrNLXLKbO1nnuoJUUHI97kTIgh NqWWvjSib1hm8LNPvMre/quUW/tNHz5eWjJIlERtPt2dbNlYDXavRxAdgoRw X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 26 Oct 2026 19:34:44 -0400 (EDT) Date: Tue, 27 Oct 2026 08:34:41 +0900 From: Michael Paquier To: Manu Cc: Zhijie Hou , shihao zhong , Takeshi Ideriha , Ayush Tiwari , alpkeles99@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19760: CLUSTER loses a row the transaction inserted and then updated in a rolled-back subtransaction Message-ID: References: <179302927929.1603125.13910327766898839560@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1/3p+6I9BcuBpWFH" Content-Disposition: inline In-Reply-To: <179302927929.1603125.13910327766898839560@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --1/3p+6I9BcuBpWFH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 26, 2026 at 12:41:19PM -0300, Manu wrote: > Thanks for taking care of it. The attached series adds the second > spot on top of e7f4463e869, as shihao asked upthread. > > + /* > + * If the updater of the tuple has already aborted (a rolled-back > + * subtransaction of the inserter), remember that, as callers like > + * rewriteheap.c rely on HEAP_XMAX_INVALID to tell a live tuple > + * from an updated one. > + */ > + if (!(tuple->t_infomask & HEAP_XMAX_INVALID) && > + !(tuple->t_infomask & HEAP_XMAX_IS_MULTI) && > + !HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask) && > + !HeapTupleHeaderIsOnlyLocked(tuple)) > + { > + TransactionId xmax = HeapTupleHeaderGetUpdateXid(tuple); > + > + /* > + * xmax == xmin: xmax is in progress too, nothing to do. > + * The clog is only a cheap filter here: a running xmax is not > + * aborted there. An abort reaches the clog before the xid > + * leaves the proc array, and the new version of the tuple, > + * whose xmin is this xmax, is in progress until then. So the > + * proc array must confirm it, as the note at the top of this > + * file asks. > + */ > + if (!TransactionIdEquals(xmax, HeapTupleHeaderGetRawXmin(tuple)) && > + TransactionIdDidAbort(xmax) && > + !TransactionIdIsInProgress(xmax)) > + SetHintBits(tuple, buffer, HEAP_XMAX_INVALID, > + InvalidTransactionId); > + } FWIW, this does not feel right. Your patch is a gathering of everybody's suggestions that have been fed to an LLM, without thinking through the problem, resulting of a pile of changes which was itself a pile of changes. I'd suggest to take three deep breaths and not rely on an LLM to try to think through all the potential holes that any of the previous suggestions have. Piling workarounds on top of workarounds is no good for these code paths. They just become more complicated to think about long-term. -- Michael --1/3p+6I9BcuBpWFH Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmrf45EACgkQnvQgOdby QH1rvBAAj0pg7fFYYRSRP5eCBXDfaBWxwd33b+KnNQncbiHLugxwTgZEFU+m4fMN 1V/rcrGAt7cPISRWuvqeYoa7LPuIFNPRDhy6zwtXx8h9ESThYqFI7NCRrG/0zAs0 ZCUt46fyS+4Lh8u0gp9T2ZNXyPky4ruS6mPlX2hgQ3tyKlVw1DInaEM6pBdp0CAA YmgfkdCC61LffCVZs6MuYLKemhA2yrPfvwKmY0/F+4e6q6I70/ik7/l9Nrs5y5cg dhpW2jPEKma/5trAukEkuVs2gKW2DyNulm5EsY6hbWdWvKyf9sFwTO/VX3aJMKQE 6bYvxjtmkp7P/SLtoUXVkLP+xoVQk3S2VwoXiT5v41810K7qHcv8RV0lbP4ZED8I rE6Z5FD/+oMo7Hvy5dS/BzZeYjjtmIlFtuvRhvIDTxJXcjJOA1stVCZrS9+kQBqI cFalp4NV5xO86J6naWs55x1VUX54AeFshv+AmF9Cd2GtLiYZKM8jmvfm3Pvq2br1 rReMHz26I7ecpY0w8gI7k1etHJUCa1GhmIt7Jmn/xl1BiWVijn5bCn4TxOII1EZW dEFSBPmd1K3QeqYIZQ8qFmV/KKOu8+8Zx9t33GbCCS7ObIdi8u7z5UAxm0C/afTt GLU6eJy6eEc9/rkqmd4pD+AVvt35mAD3dLUkjd1pF2GITrwjAog= =uGra -----END PGP SIGNATURE----- --1/3p+6I9BcuBpWFH--