cluster-ui: remove periodic triggering of db metadata job #140698
+0
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the Databases page would periodically attempt to trigger the update job in the background while the page was open. This was implemented in order to generate the freshest data possible given the constraints of the "max staleness" that's permitted via the cluster setting.
However, every check whether the data is stale requires executing a SQL query. Doing this every 10 seconds is unnecessary. Additionally, since this code uses
fetch
directly it did not contain logic to deal with 4xx errors to redirect to login or stop the requests insetInterval
.In this commit, I've decided instead of expanding the logic and writing more code to deal with additional scenarios, unregister the periodic call on the frontend, etc. I will favor maintaining less code with simpler logic. The periodic request is removed.
At the time the databases page is loaded, one attempt is made to recompute data if it's stale. Otherwise we do not recompute unless the customer requests.
Fixes: CLOUDOPS-12497
Release note (ui change): The databases metadata page updates data less eagerly while the page is open. If data is older than the staleness encoded in the
obs.tablemetadata.data_valid_duration
cluster setting we will recompute at the time the page is opened but not afterwards. Customers are encouraged to use the refresh button that is available to request that metadata be recomputed if necessary.