Skip to content

Commit

Permalink
[ML] Stop reading the ml.max_open_jobs node attribute (#115524) (#115580
Browse files Browse the repository at this point in the history
)

The ml.max_open_jobs node attribute is going away in
version 8, as the maximum number of open jobs has been
defined by a dynamic cluster-wide setting during the 7
series and there is no chance of version 8 needing to
run in a mixed version cluster with version 6.

The ml.machine_memory attribute will still be available,
so this can be checked instead as a way of detecting ML
nodes.

Co-authored-by: David Roberts <[email protected]>
  • Loading branch information
kibanamachine and droberts195 authored Oct 19, 2021
1 parent e36abb5 commit 660ed36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/ml/server/lib/node_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export async function getMlNodeCount(client: IScopedClusterClient): Promise<MlNo
if (typeof body.nodes === 'object') {
Object.keys(body.nodes).forEach((k) => {
if (body.nodes[k].attributes !== undefined) {
const maxOpenJobs = +body.nodes[k].attributes['ml.max_open_jobs'];
if (maxOpenJobs !== null && maxOpenJobs > 0) {
const machineMemory = +body.nodes[k].attributes['ml.machine_memory'];
if (machineMemory !== null && machineMemory > 0) {
count++;
}
}
Expand Down

0 comments on commit 660ed36

Please sign in to comment.