Geo: Warn if cannot find current Geo node

Problem to solve

A Geo node must have a current_node_name that matches the name of a record in the geo_nodes table. It's easy to make a one character mistake in gitlab.rb or in the /admin/geo/nodes form that breaks this relationship. When things are broken or when setup is not complete, it would really help to call attention to this information when relevant.

(Same problem description as #13352 (closed). I'm splitting out a second proposal here.)

Intended users

  • Sidney (Systems Administrator)

Proposal

  1. Sidekiq jobs should fail fast and raise exceptions when a secondary can't find its GeoNode record. This is a critical configuration problem that should only occur when Geo is initially being set up. Maybe raise in https://gitlab.com/gitlab-org/gitlab/-/blob/79583c338faa21420dcb322cc3a09bc3761d3cc5/ee/app/models/geo_node.rb#L83.
  2. Perhaps requests on Geo secondary sites should fail fast in Rails when a secondary can't find its GeoNode record? If Gitlab::Database.read_only? && GeoNode.exists? && GeoNode.current_node.nil? then flash an error on all pages that says this node doesn't know which one it is, and also show the instance's GeoNode.current_node_name? This sounds drastic, but this is a critical configuration problem that should only occur on secondaries and only when Geo is initially being set up.

Documentation

Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Links / references

Edited Mar 22, 2023 by Michael Kozono
Assignee Loading
Time tracking Loading