Add Geo rake task for checking tracking DB after promotion

What does this MR do and why?

This MR resolves #421340 (closed) by adding a new Geo rake check task (rake gitlab:geo:check). It checks if a Geo primary contains old secondary-related config entries, which should not be the case after a promotion.

TODOs:

  • Rubocop offense?
    ee/lib/system_check/geo/geo_database_promoted_check.rb:3:8: C: Gitlab/BoundedContexts: Module SystemCheck is not a valid bounded context.
    See https://docs.gitlab.com/ee/development/software_design#bounded-contexts.
    module SystemCheck
           ^^^^^^^^^^^
  • Spec tests?
    • If secondary, skip
    • If primary, no tracking DB
    • If primary, with tracking DB
  • User docs?
    • The rake task is already being mentioned on various pages
  • Changelog?

🔧 with at Adfinis

References

Screenshots or screen recordings

image

How to set up and validate locally

  1. Deploy a Geo primary and secondary
  2. Run check against primary, it should pass
  3. Run check against secondary, it should be skipped
  4. Add secondary config to primary, it should fail

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Michael Hofer

Merge request reports

Loading