Skip to content

2.27.0.0-b497

@myang2021 myang2021 tagged this 27 Aug 18:47
Summary:
Currently when --ysql_enable_read_request_cache_for_connection_auth=true, connection manager still
makes 2 master RPCs for a PG auth backend:
(1) read the latest logical catalog version;
(2) prefetch of a few catalog tables during `RelationCacheInitializePhase3()` which currently uses
the latest master catalog version;

This diff addresses (2) by using shared memory catalog version instead of the latest master catalog
version to do the prefetch, this avoids the master RPC to fetch the latest master catalog version.

Note that if heartbeat is lost for some reason, the tserver cache entry used for (2) will expire
after the time specified by --pg_cache_response_trust_auth_lifetime_limit_ms (default 60 seconds).
This is done by using `YB_YQL_PREFETCHER_TRUST_CACHE_AUTH` instead of
`YB_YQL_PREFETCHER_TRUST_CACHE`.

A new unit test is added that would fail prior to this diff.
Jira: DB-17786

Test Plan:
./yb_build.sh release --cxx-test pg_catalog_version-test --gtest_filter PgCatalogVersionConnManagerTest.*

YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestConnectionLimit
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestCorrectErrorMessage
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestDefaultConfig
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestDropAndRenameDb
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestDropAndRenameRole
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestEnquote
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestGFlags
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestLogicalClientVersion
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestMisc
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestPreparedStatements
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestSessionParameters
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestStatsAndMetrics
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestStickyConnections
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestUnixSocketConnections
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestUserContext
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestUserContextLimitedPoolSize
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestUserLoginLimit
YB_EXTRA_DAEMON_FLAGS="--ysql_enable_read_request_cache_for_connection_auth=true" ./yb_build.sh release --java-test org.yb.ysqlconnmgr.TestYCMConfiguration

Reviewers: kfranz, sanketh, #db-approvers

Reviewed By: kfranz, #db-approvers

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D46234
Assets 2
Loading