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] JIndex: Job exists and get job should read cluster state first. #36305

Merged

Conversation

davidkyle
Copy link
Member

@davidkyle davidkyle commented Dec 6, 2018

Feature branch PR

Changing methods missed in #36014 - get job and job exists.
This also adds in a missing check on PUT job that the job Id is not the same as a group Id defined in clusterstate jobs and a another check on job update that the jobs groups are not job ids.

@davidkyle davidkyle added >feature :ml Machine learning labels Dec 6, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

@@ -366,6 +341,13 @@ public void putJob(PutJobAction.Request request, AnalysisRegistry analysisRegist
return;
}

// Check the job id is not the same as a group Id
if (currentMlMetadata.isGroupOrJob(job.getId())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we also validating this when the job is written to the index?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 checks here

  1. that the job id is not a group
  2. that any groups the job has are not job Ids

I realised the second was missing so I pushed another commit with that. Previously those checks were done in the constructor of MlMetadata which further made me realise I need to perform the same check on job update so I made that change also.

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidkyle
Copy link
Member Author

retest this please

@davidkyle davidkyle merged commit a3769aa into elastic:feature-jindex-6x Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature :ml Machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants