Backport of 'Count Geo secondary registries in a single pass'
What does this MR do and why?
This MR backports !270034 (merged) to 19.4.
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 standalonedescribethat usesGeo::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
- severity label and bug subtype labels (if applicable)
- If this MR fixes a bug that affects customers, the customer label has been applied.
- This MR has been approved by a maintainer (only one approval is required).
- Ensure the
e2e:test-on-omnibus-eejob has succeeded, or if it has failed, 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:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only). - Once the backport has been merged, the commit changes will be automatically deployed to a release environment that can be used for manual validation. See after merging runbook for details.