[YSQL] The condition of "switching to per-db mode" should be refined #19182
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Jira Link: DB-7979
Description
In recent debugging of GHI issue #18711 I found an issue inside function
YBIsDBCatalogVersionMode()
. During connection establishment time, the following events happen in order:The first call to
YBIsDBCatalogVersionMode()
is during connection setup is made in step 2 byYbGetCatalogCacheVersionForTablePrefetching()
. If the cluster is already running in per-database catalog version mode, each connection still goes through the following codeThis isn't needed if
YBIsDBCatalogVersionMode()
is called before step 6, because the version 1 set here will be overwritten by the call toYbUpdateCatalogCacheVersion
in step 6. This is similar to a useless assignment that can be optimized away. Secondly, for template1, we should not reset catalog version to 1 because the upgrade script does not change the catalog version of template1. We do have internally generated connections to template1 and a user can also make an explicit connection to template1. In a connection to template1, if we reset template1's catalog version to 1, it can cause unnecessary catalog cache refresh.Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: