Skip to content

console: serve cluster detail's clusters list from the allClusters subscribe#37843

Open
leedqin wants to merge 1 commit into
MaterializeInc:mainfrom
leedqin:cluster-list-subscribe
Open

console: serve cluster detail's clusters list from the allClusters subscribe#37843
leedqin wants to merge 1 commit into
MaterializeInc:mainfrom
leedqin:cluster-list-subscribe

Conversation

@leedqin

@leedqin leedqin commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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.

…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.
@leedqin leedqin added the A-CONSOLE Area: Console label Jul 23, 2026
@leedqin
leedqin requested a review from a team as a code owner July 23, 2026 20:44
@leedqin
leedqin requested a review from Alphadelta14 July 23, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CONSOLE Area: Console

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant