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 <abhishek.rb19@gmail.com>

---------

Co-authored-by: Abhishek Radhakrishnan <abhishek.rb19@gmail.com>
This commit is contained in:
Vadim Ogievetsky 2024-05-15 20:37:15 -07:00 committed by GitHub
parent 0fb09445a5
commit 435b58f101
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 42 deletions

View File

@ -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',
check: async controls => {
// Make sure that there are broker and historical services reported from sys.servers
let sqlResult: any[];
try {
sqlResult = await queryDruidSql({
query: `SELECT
COUNT(*) AS "historicals"
FROM sys.servers
WHERE "server_type" = 'historical'`,
});
} catch (e) {
controls.addIssue(`Could not run a sys.servers query. Got: ${e.message}`);
return;
}
if (sqlResult.length === 1 && sqlResult[0]['historicals'] === 0) {
controls.addIssue(`There do not appear to be any historical services.`);
}
},
},
{
name: 'Verify that the historicals are not overfilled',
name: 'Verify that there are historicals and they are not too full',
check: async controls => {
// Make sure that no services are reported that are over 95% capacity
let sqlResult: any[];
let historicalFills: HistoricalFill[];
try {
sqlResult = await queryDruidSql({
historicalFills = await queryDruidSql({
query: `SELECT
"server" AS "service",
"curr_size" * 1.0 / "max_size" AS "fill"
"server" AS "historical",
"curr_size" * 100.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`,
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;
}
function formatPercent(service: any): string {
return (service['fill'] * 100).toFixed(2);
if (!historicalFills.length) {
controls.addIssue(`There do not appear to be any historical services.`);
return;
}
for (const service of sqlResult) {
if (service['fill'] > 0.95) {
function formatFill(historicalFill: HistoricalFill): string {
return historicalFill.fill.toFixed(2);
}
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,
)}%)`,
);
}

View File

@ -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>
.
</>
),
},