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

vogievetsky 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 435b58f1017 Web console: fix Druid doctor check to accept Java 17 
(#16250)
435b58f1017 is described below

commit 435b58f10176a3bf61bf2ffc9459bb4c70029e8c
Author: Vadim Ogievetsky <[email protected]>
AuthorDate: Wed May 15 20:37:15 2024 -0700

    Web console: fix Druid doctor check to accept Java 17 (#16250)
    
    * fix Druid doctor check
    
    * fix doc link
    
    * Update web-console/src/dialogs/doctor-dialog/doctor-checks.tsx
    
    Co-authored-by: Abhishek Radhakrishnan <[email protected]>
    
    ---------
    
    Co-authored-by: Abhishek Radhakrishnan <[email protected]>
---
 .../src/dialogs/doctor-dialog/doctor-checks.tsx    | 66 +++++++++-------------
 .../src/druid-models/flatten-spec/flatten-spec.tsx |  5 +-
 2 files changed, 32 insertions(+), 39 deletions(-)

diff --git a/web-console/src/dialogs/doctor-dialog/doctor-checks.tsx 
b/web-console/src/dialogs/doctor-dialog/doctor-checks.tsx
index db437f960e3..2104c046b88 100644
--- a/web-console/src/dialogs/doctor-dialog/doctor-checks.tsx
+++ b/web-console/src/dialogs/doctor-dialog/doctor-checks.tsx
@@ -31,6 +31,11 @@ export interface DoctorCheck {
   check: (controls: CheckControls) => Promise<void>;
 }
 
+interface HistoricalFill {
+  historical: string;
+  fill: number;
+}
+
 const RUNTIME_PROPERTIES_ALL_NODES_MUST_AGREE_ON: string[] = [
   'user.timezone',
   'druid.zk.service.host',
@@ -90,14 +95,15 @@ export const DOCTOR_CHECKS: DoctorCheck[] = [
         );
       }
 
-      // Check for Java 8 or 11
+      // Check for Java 8u92+, 11, or 17
       if (
         properties['java.specification.version'] &&
         properties['java.specification.version'] !== '1.8' &&
-        properties['java.specification.version'] !== '11'
+        properties['java.specification.version'] !== '11' &&
+        properties['java.specification.version'] !== '17'
       ) {
         controls.addSuggestion(
-          `It looks like are running Java 
${properties['java.runtime.version']}. Druid officially supports Java 8 or 11`,
+          `It looks like are running Java 
${properties['java.runtime.version']}. Druid officially supports Java 8u92+, 
11, or 17`,
         );
       }
 
@@ -291,61 +297,45 @@ export const DOCTOR_CHECKS: DoctorCheck[] = [
     },
   },
   {
-    name: 'Verify that there are historical services',
+    name: 'Verify that there are historicals and they are not too full',
     check: async controls => {
-      // Make sure that there are broker and historical services reported from 
sys.servers
-      let sqlResult: any[];
+      // Make sure that no services are reported that are over 95% capacity
+      let historicalFills: HistoricalFill[];
       try {
-        sqlResult = await queryDruidSql({
+        historicalFills = await queryDruidSql({
           query: `SELECT
-  COUNT(*) AS "historicals"
+  "server" AS "historical",
+  "curr_size" * 100.0 / "max_size" AS "fill"
 FROM sys.servers
-WHERE "server_type" = 'historical'`,
+WHERE "server_type" = 'historical'
+ORDER BY "fill" DESC`,
         });
+        // Note: for some reason adding ` AND "curr_size" * 100.0 / "max_size" 
> 90` to the filter does not work as of this writing Apr 8, 2024
       } catch (e) {
         controls.addIssue(`Could not run a sys.servers query. Got: 
${e.message}`);
         return;
       }
 
-      if (sqlResult.length === 1 && sqlResult[0]['historicals'] === 0) {
+      if (!historicalFills.length) {
         controls.addIssue(`There do not appear to be any historical 
services.`);
-      }
-    },
-  },
-  {
-    name: 'Verify that the historicals are not overfilled',
-    check: async controls => {
-      // Make sure that no services are reported that are over 95% capacity
-      let sqlResult: any[];
-      try {
-        sqlResult = await queryDruidSql({
-          query: `SELECT
-  "server" AS "service",
-  "curr_size" * 1.0 / "max_size" AS "fill"
-FROM sys.servers
-WHERE "server_type" = 'historical' AND "curr_size" * 1.0 / "max_size" > 0.9
-ORDER BY "server" DESC`,
-        });
-      } catch (e) {
-        controls.addIssue(`Could not run a sys.servers query. Got: 
${e.message}`);
         return;
       }
 
-      function formatPercent(service: any): string {
-        return (service['fill'] * 100).toFixed(2);
+      function formatFill(historicalFill: HistoricalFill): string {
+        return historicalFill.fill.toFixed(2);
       }
 
-      for (const service of sqlResult) {
-        if (service['fill'] > 0.95) {
+      for (const historicalFill of historicalFills) {
+        if (historicalFill.fill > 95) {
           controls.addIssue(
-            `Historical "${service['service']}" appears to be over 95% full 
(is ${formatPercent(
-              service,
+            `Historical "${historicalFill.historical}" appears to be over 95% 
full (is ${formatFill(
+              historicalFill,
             )}%). Increase capacity.`,
           );
-        } else {
+        } else if (historicalFill.fill > 90) {
           controls.addSuggestion(
-            `Historical "${service['service']}" appears to be over 90% full 
(is ${formatPercent(
-              service,
+            `Historical "${historicalFill.historical}" appears to be over 90% 
full (is ${formatFill(
+              historicalFill,
             )}%)`,
           );
         }
diff --git a/web-console/src/druid-models/flatten-spec/flatten-spec.tsx 
b/web-console/src/druid-models/flatten-spec/flatten-spec.tsx
index 0426eb450fb..d11ed2bdfa4 100644
--- a/web-console/src/druid-models/flatten-spec/flatten-spec.tsx
+++ b/web-console/src/druid-models/flatten-spec/flatten-spec.tsx
@@ -57,7 +57,10 @@ export const FLATTEN_FIELD_FIELDS: Field<FlattenField>[] = [
     info: (
       <>
         Specify a flatten{' '}
-        <ExternalLink 
href={`${getLink('DOCS')}/ingestion/flatten-json`}>expression</ExternalLink>.
+        <ExternalLink 
href={`${getLink('DOCS')}/ingestion/data-formats#flattenspec`}>
+          expression
+        </ExternalLink>
+        .
       </>
     ),
   },


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

Reply via email to