Skip to content

Fix/issue 40 resource manager UI - #54

Merged
leborchuk merged 6 commits into
apache:mainfrom
leborchuk:fix/issue-40-resource-manager-ui
Dec 2, 2026
Merged

leborchuk merged 6 commits into
apache:mainfrom
leborchuk:fix/issue-40-resource-manager-ui

Conversation

@leborchuk

@leborchuk leborchuk commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Check what type of resource manager we use and do not show button "Switch group" for the queue

Fix #40

Read gp_resource_manager through a bounded HTTP endpoint. Explain queue mode and hide group-only columns and details there, while disabling Move to RSG. Enable resource group presentation and movement for group and group-v2, and keep the action disabled when detection fails.

Document the endpoint and test mode responses, lookup failure and method handling.

Fixes apache#40
Add GetResourceManager to GetGPInfo and make HTTP detection delegate to it. Bound lookups to five seconds and preserve cancellation/deadline status while reporting database failures as Unavailable.

Cover queue, group and group-v2 over an in-memory gRPC transport, including lookup failure and cancellation.
@leborchuk
leborchuk requested review from tuhaihe and a balanced review from Copilot December 1, 2026 15:19
@leborchuk
leborchuk enabled auto-merge (squash) December 1, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Persistent database failures are retried until the context expires, causing the gRPC handler to return DeadlineExceeded instead of the documented Unavailable status.

1 open issue
2 files not reviewed
  • api/proto/agent_coordinator/yagpcc_get_service.pb.go: Generated file
  • api/proto/agent_coordinator/yagpcc_get_service_grpc.pb.go: Generated file
What changed in this PR

This PR adds resource-manager detection to the monitoring UI so session and query pages can distinguish resource queues from resource groups.

Changes:

  • Exposes the coordinator’s resource-manager setting through gRPC and HTTP APIs.
  • Adds shared frontend detection and notices, conditionally hides resource-group fields, and disables the query-detail switch action.
  • Adds API documentation and backend tests for responses, errors, and cancellation.
File Description
web/​src/​pages/​SessionsPage.tsx Conditionally displays resource-group columns and adds a notice.
web/​src/​pages/​SessionDetailPage.tsx Conditionally displays resource-group details and adds a notice.
web/​src/​pages/​QueryDetailPage.tsx Gates group switching and resource-group details.
web/​src/​pages/​QueriesPage.tsx Conditionally displays the resource-group column and adds a notice.
web/​src/​hooks/​useResourceManager.ts Fetches and classifies the resource-manager mode.
web/​src/​components/​ResourceManagerNotice.tsx Displays queue-mode information or lookup errors.
web/​src/​api/​client.ts Adds the resource-manager API request.
internal/​httpui/​server.go Registers and wires the HTTP endpoint.
internal/​httpui/​handler_resource_manager.go Serves the resource-manager setting as JSON.
internal/​httpui/​handler_resource_manager_test.go Tests modes, lookup failures, and method restrictions.
internal/​grpc/​resource_manager.go Implements the lookup RPC with timeout and error handling.
internal/​grpc/​resource_manager_test.go Tests RPC responses, failures, and cancellation.
internal/​grpc/​get_coordinator_info.go Initializes the resource-manager lookup dependency.
internal/​gp/​resource_manager.go Reads the coordinator’s database setting.
docs/​API.md Documents the new RPC and HTTP endpoint.
api/​proto/​agent_coordinator/​yagpcc_get_service.proto Defines the RPC and its messages.
api/​proto/​agent_coordinator/​yagpcc_get_service.pb.go Adds generated message types and descriptors.
api/​proto/​agent_coordinator/​yagpcc_get_service_grpc.pb.go Adds generated RPC client and server bindings.

Review effort: Balanced

Comment thread internal/gp/resource_manager.go Resolved
leborchuk and others added 4 commits December 1, 2026 18:56
Regenerate Go and gRPC bindings with the pinned Buf pipeline. Use leading enum comments so documentation stays attached to the correct values across generators.
Use ExecQueryNoRetry so persistent lookup errors reach the RPC's Unavailable response instead of consuming its deadline. Cover the real database-helper failure path and preserve DeadlineExceeded for actual caller deadlines.
Hiding the "Switch group" button only protected the UI: the
move-query-rsg API still ran gp_toolkit.pg_resgroup_move_query on
clusters that use resource queues. Reject such requests in
ActionService.MoveQueryToResourceGroup with FailedPrecondition, mapped
to HTTP 409, when gp_resource_manager is not group or group-v2.

Every page load queried gp_resource_manager. The setting only changes
with a restart, so cache successful lookups for one minute.

Keep resource group fields while the mode is loading or the lookup
failed, so resource group clusters do not flicker and a failed lookup
falls back to the previous view.

Assisted-by: Claude Code

@tuhaihe tuhaihe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on a 4-node Cloudberry 3.0 demo cluster in resource queue mode: /api/resource-manager returns queue, the queue notice is shown and RSG columns are hidden, move-query-rsg returns 409, and lookups are cached.

@leborchuk
leborchuk merged commit 5df5dcc into apache:main Dec 2, 2026
3 checks passed
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.

[Enhancement] UI: handle clusters using resource queues instead of showing "unknown" resource group

3 participants