Disable Geo proxy internal API polling when Geo not enabled
What does this MR do and why?
For previous context: #363575 (closed) and #350202 (closed) are related. !86468 (closed) is a previous approach which used Redis pub/sub to detect whether proxying data changes so we can fetch from the API again, but was overcomplicated for what we currently need.
With this MR, the internal API will also return a geo_enabled: true whenever Geo is enabled (lack of geo_enabled or it being false in the response would both mean Geo isn't enabled). Having geo_enabled false can be used to short-circuit the polling, as Geo being enabled is a hard requirement for Geo proxying.
As part of setting up/enabling Geo, role/config/etc changes need to happen on the nodes, so a restart is always needed, making this "safe", as a restart will get fresh data from the internal API (and should change geo_enabled after enabling Geo, resulting in polling keeping happening).
How to set up and validate locally
Can be easily tested in a GDK (and/or GET) setup, when no Geo nodes are present (Geo disabled), restarting Workhorse should result in a single request to /api/v4/geo/proxy, while after adding a Geo node, this should keep polling every 10s.
Though if you restart rails-web at the same time, it will poll every 10s until Workhorse receives one successful response from Rails.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.