diff --git a/web-console/src/dialogs/doctor-dialog/doctor-checks.tsx b/web-console/src/dialogs/doctor-dialog/doctor-checks.tsx index db437f960e39..2104c046b884 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; } +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 0426eb450fbc..d11ed2bdfa43 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[] = [ info: ( <> Specify a flatten{' '} - expression. + + expression + + . ), },