Geo: MetricsUpdateWorker timing out on counting unverified Wikis
See https://sentry.gitlap.com/gitlab/gitlabcom/issues/222377/:
PG::QueryCanceled: ERROR: canceling statement due to statement timeout
: SELECT COUNT(*) FROM "projects" INNER JOIN "project_repository_states" ON "project_repository_states"."project_id" = "projects"."id" WHERE ("project_repository_states"."wiki_verification_checksum" IS NOT NULL) AND "project_repository_states"."last_wiki_verification_failure" IS NULL
from peek/views/pg.rb:17:in `async_exec'
from peek/views/pg.rb:17:in `async_exec'
from active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
from active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
from active_support/notifications/instrumenter.rb:20:in `instrument'
from active_record/connection_adapters/abstract_adapter.rb:478:in `log'
from active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
from active_record/connection_adapters/postgresql_adapter.rb:584:in `execute_and_clear'
from active_record/connection_adapters/postgresql/database_statements.rb:160:in `exec_query'
from active_record/connection_adapters/abstract/database_statements.rb:356:in `select'
from active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
from active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
from active_record/relation/calculations.rb:270:in `execute_simple_calculation'
from active_record/relation/calculations.rb:227:in `perform_calculation'
from active_record/relation/calculations.rb:133:in `calculate'
from active_record/relation/calculations.rb:48:in `count'
from geo/repository_verification_finder.rb:25:in `count_verified_wikis'
from geo_node_status.rb:190:in `load_primary_data'
from geo_node_status.rb:175:in `load_data_from_current_node'
from geo_node_status.rb:87:in `current_node_status'
from geo/node_status_fetch_service.rb:4:in `call'
from geo/metrics_update_service.rb:58:in `node_status'
from geo/metrics_update_service.rb:28:in `fetch_geo_node_metrics'
from geo/metrics_update_service.rb:22:in `fetch_current_geo_node_metrics'
from geo/metrics_update_service.rb:12:in `execute'
from geo/metrics_update_worker.rb:10:in `block in perform'
from exclusive_lease_guard.rb:22:in `try_obtain_lease'
from geo/metrics_update_worker.rb:10:in `perform'
Edited by Stan Hu