Put Geo node statuses in the database

Description

For Geo we need the status of the different nodes in several places. So instead of fetching the status every time, have a worker to fetch it regularly and store it in the database. Other code can then get it from the database instead of fetching it themselves.

Proposal

  • Add worker that fetches Geo node statuses on a regular basis (e.g. every minute)
  • Remove all other uses of Geo::NodeStatusService, but get the node statuses from the database
  • Make /admin/geo_nodes properly work with the mechanism

Links / references

Follow-up to a discussion started by @nick.thomas (and also this one):

I don't like that we're going to have multiple unrelated jobs polling this endpoint for subsets of the data (this MR, https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3172/diffs#7d8625b2d782cbaf784b00c0f7fe9bb8ddfdb968_0_12 from @to1ne, the existing status page, and then there's the API endpoint to consider as well).

WDYT to - probably in a follow-up MR - adding a geo_node_statuses table that the primary updates by cronjob every minute? All uses of GeoNodeStatus would use the database rather than HTTP calls.

Edited Oct 27, 2017 by Toon Claes
Assignee Loading
Time tracking Loading