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 1wchzC-003Yu2-1D for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2026 11:11:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wchz9-0054hR-31 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2026 11:11:07 +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 1wchz9-0054hI-0o for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2026 11:11:07 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wchz4-00000000Aum-225k for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2026 11:11:06 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-49261a64cf4so10552645e9.2 for ; Thu, 25 Jun 2026 04:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782385861; x=1782990661; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mt56JtmlUNUlCEuTsVnIU8wn3vcj5C1rscCfXwii7BU=; b=JJE1PDhG2zmX62hFUpXB41oZX6xt8pD2uHnU4KOLPx+o4YgqI7qxHormyZ2+J+m8lz k2JGnk32FAoRZfuBh3jjHYV5mnBJF4bUsUJ4bm9vE78H9RPEB/FcCDoTY8V9pUyJLyNI XYaRo1DVAnKSxQ4fd6EpY3WWcmQIzg7/9ifCTjt52bArsDehw4DQCpWGJ0+fL+f4wIsQ dZQo7fbS5W2ohf5DFOlVMB0p+ugJF0bVS6YCaiSI/ILUzamRf7ZdFTZcTqfOU5IxRfpV mmF6AIZ/heLmNXtPnInaoqQWv2CWFeeVkooEpVry2pV3jVcYF8fqs6gi3gKjbsHSLxzr KLbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782385861; x=1782990661; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mt56JtmlUNUlCEuTsVnIU8wn3vcj5C1rscCfXwii7BU=; b=A+MISeYh8YU+G8Tqe0PCpog6hWqH12e4Vkl9WljURSJwwHmlxpBtEZdutmU3jpzpz8 9XWW8OlKwbsHsjtJl5ZLO1/bolday+ZuakyfR3IMTEegQyPIEe6iAR0q9UJA+KFrV3oN jxL7pFM2EIW7R4SndWYgxsOC0w/Qj7WIEQgVT8nTu4YSFtZvlxbGwJ55/gX1a7fh0vfu Kl2nkfreLaTlFAVvaRP93OLzgR1o4d/ktvQhv0px8k2W4eBP0i4RUQsMBXYWBuhVc2qT oT7sKKkDUat1fG9CCsgp+Qm9T/D4N7g4XzQdgbGC1qh6T0GVBTfmhjOBibxX1lbLMC7+ bRGA== X-Forwarded-Encrypted: i=1; AFNElJ8ntJMRv6UK9Zc1SGXCiwTZloPBFdYHH447T1JZzFT4Ds8Khc5b+Vqg5kKvdupqBtUtI85FN3rfQIHVwP+2@lists.postgresql.org X-Gm-Message-State: AOJu0YzBXE1XOdve9rqXr6KuB78XngW/lo0uRvRmZYJ0rjcY39b85i74 u0X306Q+v5eW1upf2hewgFnddLFsIU3C2Ec41eLesSLVYf4p4Kkocp+H X-Gm-Gg: AfdE7clPFJvIcL6UdDGrbX+h2HQQirunkGEyEVluyVgfOOyUM2Pyr0oifh0IPSnJ+Oe rzJGQpuSt15CJLw2ZM7sT/XKViHlYVeBrX2lH/KA7a5QDEKa2sLnqElWJi1F4hMQqTt+SdHoxVy yPs8g1pznGaFJp14r6T0pnszm8Glb89EJ0uqhLXjXEStmiDBGZvu+s1I9O4DLTT+w2TpfecxGO9 Y2QFltPtEwPxCMDqS1VUQvwW0rJCJKX2lccXtFAkYJcxB8fbAJ0jdAZBCcAZsfnhEPfmTHI/B9l 6/COQK0sxpHR+ksH5kErJ+DsKR3YfIBBZHgSIQeTZv14Z7w2XJlXvwNlYJkJz1X4RoXRZ4Bq+wG DH+kttY33Z5SwKHIVogYWiyHFtB1o+hqTjLOp3BAweMowcoMXpxVE2txCF9D3f0bvlVQfPfJLMQ yQP16PdhvuqfNY9x2wuYJNbED9RLbh2EwkhVGbB7U95TKpWon2P22P1v8hQG0EYV5j4Xh0RMWz X-Received: by 2002:a05:600c:1f91:b0:490:6e12:542d with SMTP id 5b1f17b1804b1-49266881932mr22300925e9.19.1782385860590; Thu, 25 Jun 2026 04:11:00 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-492660adae1sm49724245e9.4.2026.06.25.04.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2026 04:10:59 -0700 (PDT) Date: Thu, 25 Jun 2026 11:10:58 +0000 From: Bertrand Drouvot To: Jeff Davis Cc: Heikki Linnakangas , Robert Haas , Roman Eskin , Michael Paquier , Alexander Lakhin , pgsql-hackers@lists.postgresql.org, Tom Lane Subject: Re: Avoid orphaned objects dependencies, take 3 Message-ID: References: <0fc145b9b5cf3f59207cf4ca60270448a2891c46.camel@j-davis.com> <5591d661ea8189f5c057f6b48095f742e0d772f9.camel@j-davis.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="l43bZKrPq3h/RazH" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --l43bZKrPq3h/RazH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Fri, Jun 19, 2026 at 01:28:21PM +0000, Bertrand Drouvot wrote: > Hi, > > On Thu, Jun 18, 2026 at 04:21:33PM -0700, Jeff Davis wrote: > > > 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. As discussed off-list, let's move forward with this proposal (as the save a copy of the object's ACL + ROLE membership mentioned in [1] would be more complex and fragile). So PFA the new version doing so. It's the same patch series as the previous one except that it adds: 0004: Discard ACL tracking entries from aborted subtransactions It stores SubTransactionId in each AclCheckEntry at recording time. On subtransaction abort, AtEOSubXact_AclTrack() discards entries whose subxid is >= the aborting subtransaction's ID. The code is pretty simple but I suspect that adding a test would probably need to create a brand new module (say test_acltrack) with C code forcing recordDependencyOn() and BeginInternalSubTransaction()) and I'm not sure it's worth it. Indeed, I think the test would need to do things similar to what you shared in [2]. The patch is split to ease the review but should probably be merged as a single patch. [1]: https://postgr.es/m/ajVF7YWf%2Bpxs4cOf%40bdtpg [2]: https://postgr.es/m/5c629d2455946ad2fde3c184f64ea2c323ef2133.camel@j-davis.com Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --l43bZKrPq3h/RazH Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v28-0001-Recheck-permissions-after-lock-acquisition-in-de.patch"