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
- Enable the
geo_batch_count
feature flag in a Rails console on the Geo primary site:Feature.enable(:geo_batch_count)
- In a Rails console session on both sites, run the following to validate the numbers:
GeoNodeStatus.current_node_status Geo::MetricsUpdateService.new.execute
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Douglas Barbosa Alexandre