Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT 2024.1][#21635] YSQL: Allow YbInitPinnedCacheIfNeeded to on…
…ly load shared pinned cache. Summary: In order to support concurrent non-global-impact DDLs across different databases, we call YbInitPinnedCacheIfNeeded before entering the separate DDL transaction. Calling YbInitPinnedCacheIfNeeded triggers a scan of both pg_shdepend and pg_depend. This ensure that the scan of pg_shdepend and pg_depend is done without using a read time of the DDL transaction so that yb-master can retry read restarts error automatically in case a concurrent DDL in a separate database might have updated pg_shdepend that triggers a read restarts error. Otherwise, a read restart error is returned to the PG backend the DDL statement will fail because DDLs cannot be restarted. However we only support cross-database concurrent DDL and therefore we only need to call YbInitPinnedCacheIfNeeded to scan pg_shdepend. The scan of pg_depend can be delayed into the DDL transaction until it is really needed because we do not support a concurrent DDL in the same database from another connection. Unconditionally loading pg_depend has a performance hit for DDL statements that do not need to call YbInitPinnedCacheIfNeeded and it does not help to solve any problem. This diff made an API change of YbInitPinnedCacheIfNeeded to allow it to only load pg_shdepend. Jira: DB-10530 Original commit: 8487e59 / D33445 Test Plan: ./yb_build.sh --cxx-test pg_catalog_version-test Reviewers: jason Reviewed By: jason Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D33480
- Loading branch information