`Projects::IssuesController#show` should not query the postgres primary
Part of &5434 (closed)
Projects::IssuesController#show
is a major contributor to queries on our postgres primary instance, however all the queries are read-only and should therefore be getting direct to read-replicas.
My first assumption was that it was using ApplicationRecord#with_fast_statement_timeout
which is sending traffic to the primary (see #322133 (closed)), but this stack frame does not exist in the performance bar data we get back from Projects::IssuesController#show
, so I think the problem here is different.
cc @darbyfrey
Edited by Andrew Newdigate