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.94.2) (envelope-from ) id 1uIBkx-00HPdE-5v for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 19:39:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uIBkw-007chT-1l for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 19:39:05 +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.94.2) (envelope-from ) id 1uIBkv-007ceZ-NV for pgsql-hackers@lists.postgresql.org; Thu, 22 May 2025 19:39:05 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uIBkt-000MTv-1s for pgsql-hackers@lists.postgresql.org; Thu, 22 May 2025 19:39:04 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-2da3c572a0bso4072728fac.3 for ; Thu, 22 May 2025 12:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1747942743; x=1748547543; 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=1E80YbucaPURaHQTNXAvMkKvhZgdHG49UanWYhifJeI=; b=SSeklaqaOIJUaSJ2eXnQ7cZ0PiSKEGr/WZCerAd+SQqJ4eGy/gYmkPWhanaY/C031Q dL+PQsnwKlXz2VHOUm2I0Bib5J0B39cVxvMPDFf62vHZav/AmSiKW5Avg+2c8rcO5WxO oNfGzV1IeJPculRd7Pgpouv2w6IytQ3f+G4hpgk2EKmBeMc101luBcUBWXxmg4rK7OnG DkLhbIIVreMBmuay3HpGvI2eVwgK/18csVYfoakFr21golz0dBhNV8oFl5cLLTij9Drd Cz5wDEdTD6SWEbh5s3fvOYJ6x4y6q8Wo1esqEPOkwSysKQR/wWf62s+YfIs2KUM1teQI SO8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747942743; x=1748547543; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1E80YbucaPURaHQTNXAvMkKvhZgdHG49UanWYhifJeI=; b=ns+0+7khO+7HDPybmPHZMw7S5FazrHHZL70lkz9fAQdR4QTtMhj7Uask9s+FsxTwEy GlTaoWkT8XTHGAGX62l78r7yKgwqVPBB4We/9ox4cORCke9sAJ2Xz1QJpcvcOBSfUdYn KlUOALBbI14NkOYLGdcMfjR1jZTc7LuG6Br7UoVek3pfC2io9rFHQfnN1BubKi0ANcOc L+2F/y0wSFv0vXreJyjrjsCwAlA8oeVfq5c2xcCOMBS0BIDHuN86W7+YqWXPQ730u4cq F3DNUprhUa5sIvtLLntmpf37WWeZdE0xMMKidqrWjizIBODPteHFwHstlVZQvnZ82ES/ puFw== X-Forwarded-Encrypted: i=1; AJvYcCXzyBtFjeLfiR+Hn1u3MaSgGUx67xdndPILKt7pks9tDktt1mQRBLLYEi7Fdzw0WA4RxBuA/cCeuXUABH0g@lists.postgresql.org X-Gm-Message-State: AOJu0YxpY4OnPL3Tpw1drnqt5YRothk0r57hN04aahNgszjObvTmInzI 25Er6/6eqF1Zgm10bHWSrErR4J5ed7yM+ZOACu6w6aKgwNSWIp+9YZh77cbkC9Ch6aiJjdzlBEE k6b06gg== X-Gm-Gg: ASbGncuwjlTjjKpVjBpBpDs38Q3ZjU06r9fNrh84x4uvwYCGr4sYMpVuQjpf6qVeFYr C4p3nv61ebbj1Z7dHMzA3dZQ+6lRYU2UaijLeERUwcXStj1XztOBdOeoFf6RbX6OVeffXJqgSxg oVXQZWyKbF5zEJC1VU/UM1Zq8yh4RbcZsmvIkl+BT5n8OGJnocGn85EMitBl4r5+7asqgJJQoT8 ALNpv4f2o486m7mVhCnflQmu+Swj2TSDCyGPip5puF6AyrOc2q9YHOdsMXfBH2LxorUQj4Cyf+/ cKFJaPZiQC9x51j/u1Qrww9TC3CZw5mA9DSYWanQBSjt0PiF+yC55K2l68ArF8Z/xiJqG5i4RFi CD82WQ68DO1M2Nnm2dOrnWg== X-Google-Smtp-Source: AGHT+IEpLUEVJP1+KdSPvkuvjADvSYB5IQsmwmQwSRESRm+2BRxzT0LSguFyh3fSF/ywa4LmvqjapA== X-Received: by 2002:a05:6a21:6f83:b0:1f5:619a:8f79 with SMTP id adf61e73a8af0-21621876910mr40188117637.1.1747942732192; Thu, 22 May 2025 12:38:52 -0700 (PDT) Received: from jeff-ws-bridge.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b26eaf8e05fsm10058931a12.39.2025.05.22.12.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:38:51 -0700 (PDT) Message-ID: Subject: Re: Avoid orphaned objects dependencies, take 3 From: Jeff Davis To: Robert Haas , Bertrand Drouvot Cc: Michael Paquier , Alexander Lakhin , pgsql-hackers@lists.postgresql.org, Tom Lane Date: Thu, 22 May 2025 12:38:50 -0700 In-Reply-To: References: <298d95b5570b91a7d0ee42895e79890feefc67d6.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2025-05-22 at 09:40 -0400, Robert Haas wrote: > Pushing the locking down into recordDependencyOn amounts to hoping > that we don't need to study each code path in detail and decide on > the > exactly right place to acquire the lock. There are (by my rough count) over 250 call sites modified by the v19 patch. I fear that, if each of those call sites needs to be studied for the kinds of subtle issues you are describing, then we are likely to make a mistake. If not now, then in the future as new features change those call sites. Bertrand, what pattern is safe to follow for most call sites? Which call sites are the most interesting ones that need special attention? Regards, Jeff Davis