Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster-ui: remove periodic triggering of db metadata job #140698

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dhartunian
Copy link
Collaborator

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 in setInterval.

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.

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 in
`setInterval`.

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.
@dhartunian dhartunian requested a review from a team as a code owner February 7, 2025 20:48
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants