cache_has_external_issue_tracker db UPDATE causes problems in GitLab Geo

Summary

We update has_external_issue_tracker as part of the cache_has_external_issue_tracker method. This update operation is often triggered on a Geo secondary node which produces a PSQL read only error.

Steps to reproduce

Unknown.

Assumption

  • A project that exists with the has_external_issue_tracker value as nil
  • When visiting this project on the secondary node we call cache_has_external_issue_tracker to update the value.

What is the current bug behavior?

500 internal error due to an attempt at updating a read only database.

What is the expected correct behavior?

We don't try to perform an update operation on a Geo secondary node.

Possible fixes

Project.all.find_each(&:cache_has_external_issue_tracker) 

Executed on the primary node.

//cc @brodock