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 1waM3M-001k1t-19 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 23:21:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1waM3K-00E0oG-0L for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 23:21:42 +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 1waM3J-00E0o8-2J for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2026 23:21:41 +0000 Received: from mail-dy1-x1332.google.com ([2607:f8b0:4864:20::1332]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1waM3G-00000001B7b-34ol for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2026 23:21:41 +0000 Received: by mail-dy1-x1332.google.com with SMTP id 5a478bee46e88-30b6dad2382so2920057eec.0 for ; Thu, 18 Jun 2026 16:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20251104.gappssmtp.com; s=20251104; t=1781824896; x=1782429696; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=YXr7oeY3B4GGDixMlEBln+Og4DVdoMxzL+y2n/idkgQ=; b=m75x93CI1ZNjRMJm3Ds29fKYiKMODks2K4OeG7CvtkQ5IZq278w9O5zjHisEbC8E2k QVIf9EDQ9lyrhaYkFO6hGLac4zIIgC2k9lt0vMMwnSp/b8tFYZvNZkVBg+XL2xUIy84r f+wPgXWwh65n/jC3hRv4JuWgD9tl9oNto0LwrNuVPCGSo2FdN/+/VMSg9262M14tAOKW h8NKxLzSz7fWgLaGlKNX19mAxXIHlmzWJ5KMfiAyDKIqO67jcsAznCvMP8uElOKzHhWK 3cwHtNdVyPB+d0eRq9b4p8y+D/dpmJEG9baAi7pgj5JjdeK1avXJmvFxZkCvFV4vA1in Cwgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781824896; x=1782429696; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YXr7oeY3B4GGDixMlEBln+Og4DVdoMxzL+y2n/idkgQ=; b=r2aaI1NwCPEr/YVmShQOVgnx4IeumxztA3SiIqD0wJG008+DH5x9Txc7g0gTAnQpBN /A8NLMBCjvJUkTktrLQnZ9gtFSuO1+a3HATacfE8ci28co5egEVKR4pbWo0i49do3jWe zkqhmEV/NdaX040Eb9fxmPLgnRD43axIczrBs8FJTdgXjPu0R2YXTIr2QUbzX3kZcdi2 PWnTXVvwyOGeZL6T/J1kh40QaDpUz3mOx/eySu7oMTH8wDPmSGDL0bhWmkKD9c04vClS 8GD7HtYJBcM/WKJNPhXEuyncsmqBLE0ddrSJ6i3teesEX2ysCPT1lr/KKwQchvJCNpZ3 qgFA== X-Forwarded-Encrypted: i=1; AFNElJ+YaGChToaN3UGzZ9jC9P5EkzjIcPS/Bftbdm9NdX9RrNRYObE1Qo8fG/DEyvv7K9zvLszLfhpISqNXyBF1@lists.postgresql.org X-Gm-Message-State: AOJu0YwDxh50idDqWJlu1Ir8fYiwjUi9voVl9uHwofM2wDL1HJEN5Ov9 qrs8KeJkLAqo/sB6kuCKNxsiPin4vclHAwuXlTw//w3iU1NkTKxGBoHuhRrwY5bnDg== X-Gm-Gg: AfdE7ckjWMh/ICY/o/DzqYIxpsnVO0v4Ojj2YKGFbpgx6erlLrEoAfXoMdPpUeSFuYY vu1b1NMdkJd7pp/tFlR/2EXLoHizD8iqac01SB2JhHusVA/wCwp6cPDtk6cpK1GZOKARDkuupx7 s0b29WRx7snthU8SJPvdn+zxgpTKvXGxL/2LEIgjxZS+ft5ZvjvQgxV27+ugenCCCp3S1aCReQU yeWIXeLZdNSHgiMd+o5LSZ3E5fduxf31keS2+kAUhpa+IzA2LMCIa7Mf9s9zS0CvtfVcfND94U2 C7ylLThgjG/DJthwL4p5ydq15n7zykoJHDdG3ttGUyvd3darE6+Y8A1rxXMCWZCiocCn9UXpThk mRl9HC4bn6dEOiWdxPkjRWZrhwz2IfMGFwCdmtv4LsjHARFXMJh4VO7jLpcSaGAL9DRhKWVK9iR wfYOFRrAN5SBz/yOUfjdbP5N598yk9830kJ71AfmlVDgai9g== X-Received: by 2002:a05:7300:e60d:b0:304:2e00:5fb5 with SMTP id 5a478bee46e88-30c0ceaadfdmr37893eec.3.1781824896061; Thu, 18 Jun 2026 16:21:36 -0700 (PDT) Received: from jeff-ws-bridge.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30c06c30a49sm806487eec.16.2026.06.18.16.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 16:21:34 -0700 (PDT) Message-ID: <5591d661ea8189f5c057f6b48095f742e0d772f9.camel@j-davis.com> Subject: Re: Avoid orphaned objects dependencies, take 3 From: Jeff Davis To: Bertrand Drouvot Cc: Heikki Linnakangas , Robert Haas , Roman Eskin , Michael Paquier , Alexander Lakhin , pgsql-hackers@lists.postgresql.org, Tom Lane Date: Thu, 18 Jun 2026 16:21:33 -0700 In-Reply-To: References: <02e28438bd448ff4ee8f6fd78e6b74e657172d73.camel@j-davis.com> <71eb9a8835a28165939da567a9d649fe6d21bfa7.camel@j-davis.com> <0fc145b9b5cf3f59207cf4ca60270448a2891c46.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1.1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2026-06-17 at 05:44 +0000, Bertrand Drouvot wrote: > > IIUC, this is necessary for correctness. If an ACL failure doesn't > > cause a transaction abort, then there's a danger that we cause the > > transaction to fail that should have succeeded. >=20 > Exactly, because we'd recheck an "harmless" failed ACL check and then > produce > an error. >=20 > > So the ACL tracking needs to be precise: we can't track an ACL > > check > > unless a failure always causes transaction abort; and we must track > > an > > ACL check if it would cause a transaction abort. Right? >=20 > I would say: we just need to track (and recheck) ACL checks that > succeeded. IIUC, we cannot have false positives (tracking ACL checks that wouldn't have caused an abort) nor can we have false negatives (missing an ACL check that could cause an abort). It's hard for me to convince myself that we got all the cases right; and if we have, that they won't be broken in the future. For instance, I just realized that something else I'm working on is related: https://www.postgresql.org/message-id/5c629d2455946ad2fde3c184f64ea2c323ef2= 133.camel@j-davis.com It does an ACL check inside a subtransaction, where the parent transaction is a DDL statement. It happens to be a DROP statement, so it's not recording new dependencies, so I don't think it breaks your tracking mechanism, but it's too close for comfort. We could keep the transaction ID in the tracking record, and ignore entries from an aborted subxact. But it's getting fairly complex and delicate. Thoughts? Regards, Jeff Davis