Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 28 additions & 38 deletions web-console/src/dialogs/doctor-dialog/doctor-checks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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`,
);
}

Expand Down Expand Up @@ -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,
)}%)`,
);
}
Expand Down
5 changes: 4 additions & 1 deletion web-console/src/druid-models/flatten-spec/flatten-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
.
</>
),
},
Expand Down