Skip to content

Geo - Optimize Geo::MetricsUpdateWorker slow total replicables count queries

What does this MR do and why?

This MR reuses the Gitlab::Utils::UsageData to count the number of available replicables on the Geo primary. This change is behind a feature flag.

Related issue

Related to #370158 (comment 1056001661)

How to set up and validate locally

  1. Enable the geo_batch_count feature flag in a Rails console on the Geo primary site:
    Feature.enable(:geo_batch_count)
  2. In a Rails console session on both sites, run the following to validate the numbers:
    GeoNodeStatus.current_node_status
    Geo::MetricsUpdateService.new.execute
  3. You can also visit the Geo site admin page on any site or run the following rake task on the Geo secondary site and check if the numbers are correct:
    bundle exec rails geo:status

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Douglas Barbosa Alexandre

Merge request reports