Summary:
To control aggregate postgres backend catalog cache memory size, we now only allow internal
connections to build the relcache init file. But when they do catalog cache preload, they still
preload system entries and user defined entries. In the past there was one extreme user case
where a single connection rebuild of catalog cache spiked to as much as 33GB, and then 14GB in
stable state. In fact that case was the reason why minimal catalog preload was introduced.
Internal connections, especially the one that is triggered just to rebuild the relcache init file,
only needs to do minimal catalog preload which is sufficient to rebuild the relcache init file. This
is because relcache init file contains cached metadata exclusively for the system catalog tables and
their indexes. It does not contain any user-defined relations.
I made a change to do minimal catalog preload for internal connections. In this way we have
better control over the potential catalog cache memory spike.
Jira: DB-18472
Test Plan: jenkins
Reviewers: kfranz, sanketh
Reviewed By: kfranz
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D47632