Geo: `TrendingProjects.refresh!` is executed in Secondary node
https://sentry.gitlap.com/gitlab/gitlab-geo-internal-develop-is/issues/35544/
PG::ReadOnlySqlTransaction: ERROR: cannot execute DELETE in a read-only transaction
app/models/trending_project.rb:17:in `block in refresh!'
delete_all
app/models/trending_project.rb:16:in `refresh!'
transaction do
app/workers/trending_projects_worker.rb:8:in `perform'
TrendingProject.refresh!
lib/gitlab/sidekiq_status/server_middleware.rb:5:in `call'
ret = yield
lib/gitlab/sidekiq_middleware/request_store_middleware.rb:6:in `call'
yield
...
(46 additional frame(s) were not displayed)
ActiveRecord::StatementInvalid: PG::ReadOnlySqlTransaction: ERROR: cannot execute DELETE in a read-only transaction
: DELETE FROM "trending_projects"
PG::ReadOnlySqlTransaction: ERROR: cannot execute DELETE in a read-only transaction
: DELETE FROM "trending_projects"
Edited by Gabriel Mazetto