console: serve cluster detail's clusters list from the allClusters subscribe#37843
Open
leedqin wants to merge 1 commit into
Open
console: serve cluster detail's clusters list from the allClusters subscribe#37843leedqin wants to merge 1 commit into
leedqin wants to merge 1 commit into
Conversation
…bscribe The cluster detail page polled the whole cluster fleet every 5s through useClusters (replica status history join plus jsonb aggregation per cluster). The console already maintains a global mz_clusters SUBSCRIBE (the allClusters atom), so the breadcrumb cluster switcher and the replicas tab now read from that instead. Ownership was the one thing the subscribe could not provide. The poll computed isOwner server-side via has_role(), which cannot run inside a SUBSCRIBE dataflow. buildClustersQuery now also selects owner_id, and a new useOwners hook fetches the small mz_roles ownership query on a 60s interval. Consumers join ownerId to isOwner client-side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The cluster detail page polled the whole cluster fleet every 5s through useClusters (replica status history join plus jsonb aggregation per cluster). The console already maintains a global mz_clusters SUBSCRIBE (the allClusters atom), so the breadcrumb cluster switcher and the replicas tab now read from that instead.
Ownership was the one thing the subscribe could not provide. The poll computed isOwner server-side via has_role(), which cannot run inside a SUBSCRIBE dataflow. buildClustersQuery now also selects owner_id, and a new useOwners hook fetches the small mz_roles ownership query on a 60s interval. Consumers join ownerId to isOwner client-side.