You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by gi...@apache.org on 2026/05/19 05:27:18 UTC

(druid) branch master updated: fix: web console services card omits most service types without SQL (#19481)

This is an automated email from the ASF dual-hosted git repository.

gianm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new a1181533931 fix: web console services card omits most service types without SQL (#19481)
a1181533931 is described below

commit a11815339311a56ed1292b1965c4e39ba8bc572a
Author: nuyb <10...@users.noreply.github.com>
AuthorDate: Tue May 19 14:27:12 2026 +0900

    fix: web console services card omits most service types without SQL (#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.
---
 .../home-view/services-card/services-card.tsx      | 26 +++++++++++++++-------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/web-console/src/views/home-view/services-card/services-card.tsx b/web-console/src/views/home-view/services-card/services-card.tsx
index 722c8a43c61..3923c6f3456 100644
--- a/web-console/src/views/home-view/services-card/services-card.tsx
+++ b/web-console/src/views/home-view/services-card/services-card.tsx
@@ -22,6 +22,7 @@ import { PluralPairIfNeeded } from '../../../components';
 import { getConsoleViewIcon } from '../../../druid-models';
 import type { Capabilities } from '../../../helpers';
 import { useQueryManager } from '../../../hooks';
+import { Api } from '../../../singletons';
 import { getApiArray, lookupBy, queryDruidSql } from '../../../utils';
 import { HomeViewCard } from '../home-view-card/home-view-card';
 
@@ -60,16 +61,25 @@ export const ServicesCard = React.memo(function ServicesCard(props: ServicesCard
           x => x.count,
         );
       } else if (capabilities.hasCoordinatorAccess()) {
-        const services = await getApiArray('/druid/coordinator/v1/servers?simple', signal);
-
-        const middleManager = capabilities.hasOverlordAccess()
-          ? await getApiArray('/druid/indexer/v1/workers', signal)
-          : [];
+        // /druid/coordinator/v1/cluster is discovery-backed and reports every node role
+        // (the same source sys.servers uses), so the fallback matches the SQL branch.
+        // /druid/coordinator/v1/servers?simple is segment-inventory-backed and only sees
+        // historical, indexer-executor (peon), and any broker that holds broadcast segments,
+        // so it is only used here to surface the peon count, which the cluster endpoint
+        // does not return.
+        const clusterResp = await Api.instance.get('/druid/coordinator/v1/cluster', { signal });
+        const cluster: Record<string, unknown[]> = clusterResp.data || {};
+        const segmentServers = await getApiArray('/druid/coordinator/v1/servers?simple', signal);
 
         return {
-          historical: services.filter((s: any) => s.type === 'historical').length,
-          middle_manager: middleManager.length,
-          peon: services.filter((s: any) => s.type === 'indexer-executor').length,
+          coordinator: (cluster.coordinator || []).length,
+          overlord: (cluster.overlord || []).length,
+          router: (cluster.router || []).length,
+          broker: (cluster.broker || []).length,
+          historical: (cluster.historical || []).length,
+          middle_manager: (cluster.middleManager || []).length,
+          indexer: (cluster.indexer || []).length,
+          peon: segmentServers.filter((s: any) => s.type === 'indexer-executor').length,
         };
       } else {
         throw new Error(`must have SQL or coordinator access`);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org