Repository navigation
Fix/issue 40 resource manager UI - #54
Merged
leborchuk merged 6 commits intoDec 2, 2026
Merged
Conversation
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.
There was a problem hiding this comment.
🟡 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 fileapi/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
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
approved these changes
Dec 2, 2026
tuhaihe
left a comment
Member
There was a problem hiding this comment.
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.
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.

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