Query cache is enabled for load balancer connections in a console session
During an incident where we were running some commands in a Rails console, we noticed that queries were being cached.
In https://gitlab.com/gitlab-org/gitlab/commit/a55a37fb7721fd12ef6fa06db3aecf455ae11089, we enabled query caching for the replica pools. We [enable the query cache just before we checkout a connection for read queries](https://gitlab.com/gitlab-org/gitlab/blob/23d80765b0189e6c013dc9a1a6e57514b7ee3c57/ee/lib/gitlab/database/load_balancing/load_balancer.rb#L35).
This is different from `ActiveRecord::Base.connection_pool` where the cache is enabled using executor hooks. So it's enabled when a request starts and cleared when it ends.
I think in most cases it would be better for the query cache to be disabled in the console.
cc @igorwwwwwwwwwwwwwwwwwwww @nmilojevic1 @ayufan
issue