wlswo opened a new pull request, #19481:
URL: https://github.com/apache/druid/pull/19481

   The home dashboard's Services card has two code paths: the SQL path counts 
every node role via sys.servers, while the coordinator-only fallback was 
calling /druid/coordinator/v1/servers?simple — an inventory-backed endpoint 
that only reports segment-loading servers (historical, peon, and brokers that 
hold broadcast segments). As a result, on clusters where the console talks to 
the coordinator without SQL, overlord, coordinator, router, broker, and indexer 
counts were silently dropped from the card, making the cluster look smaller 
than it actually is.
   
   Switch the fallback to /druid/coordinator/v1/cluster, which is backed by 
DruidNodeDiscoveryProvider — the same discovery source sys.servers exposes — so 
it reports every node role. The /servers?simple call is kept just to surface 
the peon count, which the cluster endpoint does not return. As a side effect, 
the /druid/indexer/v1/workers call (and the hasOverlordAccess() requirement 
that gated it) is no longer needed: middle_manager comes from the cluster 
endpoint.
   
   Verified against a Druid 30.0.0 cluster with SQL disabled in the console: 
the fallback now matches the SQL branch's output for the same cluster.
   
   <!-- Thanks for trying to help us make Apache Druid be the best it can be! 
Please fill out as much of the following information as is possible (where 
relevant, and remove it when irrelevant) to help make the intention and scope 
of this PR clear in order to ease review. -->
   
   <!-- Please read the doc for contribution 
(https://github.com/apache/druid/blob/master/CONTRIBUTING.md) before making 
this PR. Also, once you open a PR, please _avoid using force pushes and 
rebasing_ since these make it difficult for reviewers to see what you've 
changed in response to their reviews. See [the 'If your pull request shows 
conflicts with master' 
section](https://github.com/apache/druid/blob/master/CONTRIBUTING.md#if-your-pull-request-shows-conflicts-with-master)
 for more details. -->
   
   Fixes #XXXX.
   
   <!-- Replace XXXX with the id of the issue fixed in this PR. Remove this 
section if there is no corresponding issue. Don't reference the issue in the 
title of this pull-request. -->
   
   <!-- If you are a committer, follow the PR action item checklist for 
committers:
   
https://github.com/apache/druid/blob/master/dev/committer-instructions.md#pr-and-issue-action-item-checklist-for-committers.
 -->
   
   ### Description
   
   The home dashboard's Services card has two code paths. The SQL path counts 
every node role via `sys.servers`, while
   the coordinator-only fallback was calling 
`/druid/coordinator/v1/servers?simple` — an inventory-backed endpoint that
   only reports segment-loading servers (historical, peon, and brokers that 
hold broadcast segments). As a result, on
   clusters where the console talks to the coordinator without SQL, **overlord, 
coordinator, router, broker, and indexer
    counts were silently dropped from the card**, making the cluster look 
smaller than it actually is.
   
   This change switches the fallback to `/druid/coordinator/v1/cluster`, which 
is backed by `DruidNodeDiscoveryProvider`
    — the same discovery source `sys.servers` exposes — so it reports every 
node role. The `/servers?simple` call is
   kept just to surface the peon count, which the cluster endpoint does not 
return.
   
   As a side effect, the `/druid/indexer/v1/workers` call (and the 
`hasOverlordAccess()` requirement that gated it) is
   no longer needed: `middle_manager` now comes from the cluster endpoint.
   
   #### Verified on a Druid 30.0.0 cluster (SQL branch disabled in the console)
   
   The cluster has 1 overlord, 1 coordinator, 1 router, 1 broker, 2 
historicals, 2 middle managers, and 1 peon.
   
   **Before** — coordinator fallback drops overlord/coordinator/router/broker:
   
   <여기에 before.png 드래그앤드롭>
   
   **After** — fallback now matches the SQL branch output:
   
   <여기에 after.png 드래그앤드롭>
   
   #### Release note
   
   The home view's Services card now correctly reports overlord, coordinator, 
router, broker, and indexer counts on
   clusters where the web console talks to the coordinator without SQL access.
   
   ##### Key changed/added classes in this PR
   - `web-console/src/views/home-view/services-card/services-card.tsx`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added documentation for new or modified features or behaviors. *(N/A — 
UI count fix, no user-facing docs)*
   - [x] a release note entry in the PR description.
   - [x] added Javadocs for most classes and all non-trivial methods. *(N/A — 
TypeScript)*
   - [x] added or updated version, license, or notice information in
   [licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml) 
*(N/A — no dependency change)*
   - [x] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar
   reader.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code
   
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met. *(existing snapshot
   test still passes; fallback code path is gated on capabilities and exercised 
manually)*
   - [x] added integration tests. *(N/A)*
   - [x] been tested in a test Druid cluster. *(verified locally against a 
Druid 30.0.0 cluster with the SQL branch
   disabled in the console; see screenshots)*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to