Backport of 'Count Geo secondary registries in a single pass'

What does this MR do and why?

This MR backports !270034 (merged) to 19.5.

On a secondary, each status update counts every registry table six times, with one batch_count loop per metric. On sites with 300M+ job artifacts, the collection can run past its 50-minute limit. No status is saved, and the site eventually shows as unhealthy (#637128 (closed)).

!270034 (merged) adds Gitlab::Geo::Replicator.registry_counts, which gets all six counts from one grouped batch_count. GeoNodeStatus and the geo:status Rake task use it only when the geo_single_pass_registry_counts ops flag is enabled. The flag is disabled by default, so nothing changes until an administrator enables it.

The application code applied cleanly. Two specs conflicted, both on the uploads aggregate specs from !263961 (merged), which is not on this branch:

  • ee/spec/models/geo_node_status_spec.rb: the uploads aggregate context is left out.
  • ee/spec/lib/gitlab/geo/geo_node_status_check_spec.rb: the uploads aggregate block is left out. Its two flag tests (one grouped count with the flag on, the individual counts with it off) now sit in a standalone describe that uses Geo::JobArtifactReplicator.

MR acceptance checklist

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

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the E2E Omnibus GitLab EE pipeline (triggered by thee2e:test-on-omnibus-ee job) has succeeded. If it has failed (or shows warnings), investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Chloe Fons

Merge request reports

Loading
Loading