Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Removing use of ignore_throttled #199107

Merged
Merged
1 change: 0 additions & 1 deletion x-pack/packages/ml/aiops_log_pattern_analysis/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const indicesOptionsSchema = schema.object({
),
ignore_unavailable: schema.maybe(schema.boolean()),
allow_no_indices: schema.maybe(schema.boolean()),
ignore_throttled: schema.maybe(schema.boolean()),
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const aiopsLogRateAnalysisBase = schema.object({
end: schema.number(),
searchQuery: schema.string(),
timeFieldName: schema.string(),
// when v2 is removed, includeFrozen should not carry over to v3+
includeFrozen: schema.maybe(schema.boolean()),
grouping: schema.maybe(schema.boolean()),
/** Analysis selection time ranges */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ export const paramsMock = {
baselineMax: 20,
deviationMin: 30,
deviationMax: 40,
includeFrozen: false,
searchQuery: '{ "match_all": {} }',
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

import type { AiopsLogRateAnalysisSchema } from '../api/schema';

export const getRequestBase = ({ index, includeFrozen }: AiopsLogRateAnalysisSchema) => ({
export const getRequestBase = ({ index }: AiopsLogRateAnalysisSchema) => ({
index,
...(includeFrozen ? { ignore_throttled: false } : {}),
ignore_unavailable: true,
});
Original file line number Diff line number Diff line change
Expand Up @@ -10765,10 +10765,6 @@
"ignore_unavailable": {
"description": "If true, missing or closed indices are not included in the response.",
"type": "boolean"
},
"ignore_throttled": {
"description": "If true, concrete, expanded or aliased indices are ignored when frozen.",
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -10884,4 +10880,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7932,10 +7932,6 @@
"ignore_unavailable": {
"description": "If true, missing or closed indices are not included in the response.",
"type": "boolean"
},
"ignore_throttled": {
"description": "If true, concrete, expanded or aliased indices are ignored when frozen.",
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -8051,4 +8047,4 @@
}
}
}
}
}
4 changes: 4 additions & 0 deletions x-pack/plugins/ml/server/models/job_service/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ export function jobsProvider(
const result: { datafeed?: Datafeed; job?: Job } = { job: undefined, datafeed: undefined };
if (datafeedResult && datafeedResult.job_id === jobId) {
result.datafeed = datafeedResult;
if (result.datafeed.indices_options?.ignore_throttled !== undefined) {
// ignore_throttled is a deprecated setting, remove it from the response
delete result.datafeed.indices_options.ignore_throttled;
}
}

if (jobResults?.jobs?.length > 0) {
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/ml/server/routes/schemas/datafeeds_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const indicesOptionsSchema = schema.object({
),
ignore_unavailable: schema.maybe(schema.boolean()),
allow_no_indices: schema.maybe(schema.boolean()),
// retaining the deprecated ignore_throttled in case an older jobs are used
// we don't want to fail the schema validation if this is present
ignore_throttled: schema.maybe(schema.boolean()),
failure_store: schema.maybe(schema.string()),
});

export const datafeedConfigSchema = schema.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export default function ({ getService }: FtrProviderContext) {
expand_wildcards: ['open'],
ignore_unavailable: false,
allow_no_indices: true,
ignore_throttled: true,
},
query: {
match_all: {},
Expand Down Expand Up @@ -140,7 +139,6 @@ export default function ({ getService }: FtrProviderContext) {
expand_wildcards: ['open'],
ignore_unavailable: false,
allow_no_indices: true,
ignore_throttled: true,
},
query: {
bool: {
Expand Down Expand Up @@ -217,7 +215,6 @@ export default function ({ getService }: FtrProviderContext) {
expand_wildcards: ['open'],
ignore_unavailable: false,
allow_no_indices: true,
ignore_throttled: true,
},
query: {
match_all: {},
Expand Down Expand Up @@ -317,7 +314,6 @@ export default function ({ getService }: FtrProviderContext) {
expand_wildcards: ['open'],
ignore_unavailable: false,
allow_no_indices: true,
ignore_throttled: true,
},
query: {
bool: {
Expand Down