Commit Graph

5236 Commits

Author SHA1 Message Date
Zachary Tong 4285335dfb [ML] Add a 'force' parameter to CloseJob and StopDataFeed endpoints (elastic/x-pack-elasticsearch#710)
If forced, the internal RemovePersistentTasks API is invoked instead of going through
ML.  This will remove the task, which should trigger the task framework to do
necessary cleanup.

At that point, the Delete* APIs interpret a missing task as CLOSED/STOPPED,
so they can be removed regardless of the original state.

Original commit: elastic/x-pack-elasticsearch@bff23c7840
2017-03-24 13:10:20 -04:00
Martijn van Groningen 1d660f373f [ML] Only push live update if job is opened
Original commit: elastic/x-pack-elasticsearch@5318d65012
2017-03-24 16:32:38 +01:00
Colin Goodheart-Smithe 60a3fbff85 [TEST] Roce ML post data test to use just JSON
This is temporary will we investigate why the test fails when SMILE is used

Original commit: elastic/x-pack-elasticsearch@55c7983a21
2017-03-24 15:23:51 +00:00
David Roberts f816a5708c [ML] Rename action now it's run by _xpack instead of _system (elastic/x-pack-elasticsearch#831)
The _xpack user cannot run internal actions

Original commit: elastic/x-pack-elasticsearch@2dc4a30582
2017-03-24 15:20:20 +00:00
Zachary Tong d33cbaf9be Remove unnecessary norelease
Original commit: elastic/x-pack-elasticsearch@a3bd568a72
2017-03-24 10:28:58 -04:00
Colin Goodheart-Smithe caa9afad2b [TEST] fixed content type in ML QA tests
Original commit: elastic/x-pack-elasticsearch@b7749e1319
2017-03-24 14:08:39 +00:00
Colin Goodheart-Smithe fd54515ecb [ML] Support all XContent types in Data API (elastic/x-pack-elasticsearch#812)
* [ML] Support all XContent types in Data API

This changes the POST Data API so that it accepts all XContent types instead of just JSON.

For now the datafeed is restricted to only sending JSON to the POST data API.

* Rename SimpleJsonRecordReader to XContentRecordReader

Also renames `DataFormat.JSON` to `DataFormat.XCONTENT`

* fixes YAML tests

Original commit: elastic/x-pack-elasticsearch@5fd20690b8
2017-03-24 12:57:02 +00:00
Dimitris Athanasiou 73434dadeb [ML] Remove recursion in bucket expansion (elastic/x-pack-elasticsearch#832)
Relates elastic/x-pack-elasticsearch#752

Original commit: elastic/x-pack-elasticsearch@85392296a5
2017-03-24 12:51:22 +00:00
Dimitrios Athanasiou 28d6b505ed [ML] Minor refactoring to improve code readability
Original commit: elastic/x-pack-elasticsearch@ef2d5fcab6
2017-03-24 10:52:38 +00:00
Martijn van Groningen c85498462c [ML] Replaced norelease with regular todo
Original commit: elastic/x-pack-elasticsearch@c4c8955c3f
2017-03-24 11:46:34 +01:00
Dimitris Athanasiou 1cfd9bd986 [ML] Add ml jobs and datafeeds in usage API (elastic/x-pack-elasticsearch#805)
This adds basic info about jobs and datafeeds, sufficient
for the first release for supporting monitoring and
phone-home.

In particular, usage now displays:

- job count for _all and by state
- detectors statistics (min, max, mean, total) for _all jobs and by job state
- model size statistics (min, max, mean, total) for _all jobs and by job state
- datafeed count for _all and by state

Relates elastic/x-pack-elasticsearch#660

Original commit: elastic/x-pack-elasticsearch@6e0da6c3db
2017-03-24 10:42:12 +00:00
Colin Goodheart-Smithe ea67089cef [ML] Cleans up some NORELEASES (elastic/x-pack-elasticsearch#830)
This change cleans up some NORELEASE comments that are either no longer relevant or actually should be TODO comments

Original commit: elastic/x-pack-elasticsearch@9947f1176e
2017-03-24 10:11:05 +00:00
Dimitrios Athanasiou cc5c34e037 [TEST] Fix open_time assertions
Original commit: elastic/x-pack-elasticsearch@a26425970c
2017-03-24 09:53:29 +00:00
Martijn van Groningen 96f4a72825 [ML] Change how update job api delegates config changes to autodetect process
Submit job updates to a concurrent queue when job update has been processed by ClusterService. Then from a background thread delegate the job updates to the node running the autodetect process. This maintains the same order as how the job config updates have occurred to the cluster state and thus preventing job config updates to the same job to arrive in the wrong order to the job's autodetect process. (the expectation is that in practise this will rarely happen)

The behaviour of the update api changes with this pr, because the api now returns when the update has been made to cluster state, whereas before it would return when the update was made to the autodetect process too. Updating the autodetect process happens in the background. I think that this change in behaviour is acceptable.
Use TP#scheduleWithFixedDelay(...) instead of TP#schedule(...) and
removed the custom rescheduling and cancelling.
Also changed LocalNodeMasterListener#executorName to SAME

Original commit: elastic/x-pack-elasticsearch@c24c0dd7d7
2017-03-24 09:30:55 +01:00
Hendrik Muhs f687f3ea6e [ML] fix test mix up of millisecond with second (elastic/x-pack-elasticsearch#816)
Fix spurious Test failure

fix test resolution bug: mix up of millisecond with second

Original commit: elastic/x-pack-elasticsearch@37b8fed559
2017-03-24 08:11:38 +01:00
Dimitrios Athanasiou 061e3fc1fe [TEST] fix open_time in jobs_get_stats YAML test
Original commit: elastic/x-pack-elasticsearch@2a1c62ab3c
2017-03-23 19:33:26 +00:00
Hendrik Muhs a8b1b3e863 Revert "disable integration test, see elastic/x-pack-elasticsearch#823 for details (elastic/x-pack-elasticsearch#824)"
This reverts commit elastic/x-pack-elasticsearch@2338b3c972.

Original commit: elastic/x-pack-elasticsearch@a9c7168762
2017-03-23 20:10:58 +01:00
Hendrik Muhs 27dce8669c disable integration test, see elastic/x-pack-elasticsearch#823 for details (elastic/x-pack-elasticsearch#824)
[ML] disable failing integration test, see elastic/x-pack-elasticsearch#823 for details

Original commit: elastic/x-pack-elasticsearch@2338b3c972
2017-03-23 19:54:02 +01:00
Martijn van Groningen 1bed557911 [ML] Fork on management thread when really opening the job
Original commit: elastic/x-pack-elasticsearch@e528912c23
2017-03-23 19:48:11 +01:00
Dimitris Athanasiou 99e3508267 [ML] Change chunking_config.time_span into a TimeValue (elastic/x-pack-elasticsearch#808)
Original commit: elastic/x-pack-elasticsearch@42d7b06e3f
2017-03-23 18:45:53 +00:00
Zachary Tong e739d86f00 Replace norelease with TODO
Not a blocker, issue opened under elastic/x-pack-elasticsearch#821

Original commit: elastic/x-pack-elasticsearch@d46f6bc556
2017-03-23 13:14:10 -04:00
Zachary Tong c680b79641 Remove norelease
Issue elastic/x-pack-elasticsearch#820 filed to track progress of better error handling, but not a blocker so removing
the norelease

Original commit: elastic/x-pack-elasticsearch@82cf6eebe2
2017-03-23 13:07:50 -04:00
Zachary Tong cf6bca96db Remove norelease and adjust audit logging
Audit logging in wrong location.  Norelease removed because the proper solution
will take some more work, and this edge-case is not likely to be run into frequently.

More details in elastic/x-pack-elasticsearch#818

Original commit: elastic/x-pack-elasticsearch@ab0d731abf
2017-03-23 13:01:37 -04:00
Igor Motov fba5c09e3d Persistent Tasks: remove task restart on failure (elastic/x-pack-elasticsearch#815)
If a persistent task throws an exception, the persistent tasks framework will no longer try to restart the task. This is a temporary measure to prevent threshing the cluster with endless restart attempt. We will revisit this in the future version to make the restart process more robust. Please note, however, that if node executing the task goes down, the task will still be restarted on another node.

Original commit: elastic/x-pack-elasticsearch@30712e0fbf
2017-03-23 12:56:48 -04:00
Hendrik Muhs 6f7f466fa3 [ML] move DataStreamDiagnostics into DataCountsReporter (elastic/x-pack-elasticsearch#775)
repair DataStreamDiagnostics

Moves DataStreamDiagnostics into DataCountsReporter to survive if job is opened/closed/fed in chunks.

relates elastic/x-pack-elasticsearch#764

Original commit: elastic/x-pack-elasticsearch@29c221a451
2017-03-23 16:43:51 +01:00
Martijn van Groningen bb9befcdcb [ML] Include MlMetadata in all xcontent contexts.
Original commit: elastic/x-pack-elasticsearch@e870b5bf6d
2017-03-23 16:10:24 +01:00
Colin Goodheart-Smithe dde0570296 [ML] Removes direct dependency on Jackson Parser (elastic/x-pack-elasticsearch#810)
* [ML] Removes direct dependency on Jackson Parser

The classes that read data from the post data action ready to write to the autodetect process had a direct dependency on Jackson’s `Parser` class. This changes makes those classes depend on XContent instead making them consistent with the way we parse requests and data across Elasticsearch and X-Pack.

* Simplify json record reader

This commit removes the unnecessary `AbstractJsonRecordReader` and `JsonRecordReader` interfaces/classes. These are not required as we do and should only have one implementation of reading json records.

Original commit: elastic/x-pack-elasticsearch@366b8af943
2017-03-23 13:56:32 +00:00
David Roberts 7756067e5d [ML] Check underlying index permissions on datafeed PUT (elastic/x-pack-elasticsearch#809)
Also added a test to ensure underlying index permissions are required
for datafeed preview.

Relates elastic/x-pack-elasticsearch#648

Original commit: elastic/x-pack-elasticsearch@6edadbb401
2017-03-23 13:56:04 +00:00
Martijn van Groningen 93d7b8c14b [ML] State check doesn't need to know if task is stale now that task validation is only done at create time.
Original commit: elastic/x-pack-elasticsearch@d19858240b
2017-03-23 14:40:20 +01:00
Martijn van Groningen df86125a7d [TEST] Adjust assertions.
Original commit: elastic/x-pack-elasticsearch@39b289a4d9
2017-03-23 11:34:39 +01:00
Colin Goodheart-Smithe 795a00ddab Removes unnecessary NORELEASE for ML endpoint
Original commit: elastic/x-pack-elasticsearch@bbb203665b
2017-03-23 08:47:37 +00:00
Tim Vernum 3e0f785f0c Add ldap_dn and ldap_groups to user meta-data (elastic/x-pack-elasticsearch#739)
In the LdapRealm, include the user's DN and the list of groups (the DN for each group) in the User object
This allows this information to be referenced in templated roles.

Closes: elastic/x-pack-elasticsearch#729

Original commit: elastic/x-pack-elasticsearch@065f337109
2017-03-23 15:38:57 +11:00
Zachary Tong cc7a1a821f [ML] Load resource and split into keys manually (elastic/x-pack-elasticsearch#786)
Manually loads the resources, splits the lines and fills the map instead of using the ResourceBundle stuff. 

relates elastic/x-pack-elasticsearch#750 

Original commit: elastic/x-pack-elasticsearch@25ff4d5d19
2017-03-22 15:24:47 -04:00
Igor Motov 5c4933f5ea Make PersistentAction independent from TransportActions (elastic/x-pack-elasticsearch#742)
Removes the transport layer dependency from PersistentActions, makes PersistentActionRegistry immutable and rename actions into tasks in class and variable names.

Original commit: elastic/x-pack-elasticsearch@e3e5b79c28
2017-03-22 14:02:30 -04:00
Martijn van Groningen d779bf66a5 [ML] Also serialize the job id in a update job request.
Relates to elastic/x-pack-elasticsearch#787 and elastic/x-pack-elasticsearch#799

Original commit: elastic/x-pack-elasticsearch@fc64d25bcb
2017-03-22 18:09:10 +01:00
Martijn van Groningen 6ddc626c17 [ML] Never restart job locally upon cancel
Relates to elastic/x-pack-elasticsearch#749

Original commit: elastic/x-pack-elasticsearch@6943d75178
2017-03-22 17:09:19 +01:00
Martijn van Groningen f20efa7152 [ML] Renamed action names from */anomaly_detectors/* to */job/*
The action name is currently inconsistent with the class name.
Also as more types of jobs will be added, they should reuse the existing actions,
so it make more sense to gave a generic job name for the action name. Note that
it is ok to have additional rest handlers for new type of jobs.

Original commit: elastic/x-pack-elasticsearch@a70d46fb8a
2017-03-22 16:47:27 +01:00
Martijn van Groningen a59badf842 [ML] Restore model state as part of opening a job.
Before the model state was restored in the background when the job was already opened.

 relates elastic/x-pack-elasticsearch#751

Original commit: elastic/x-pack-elasticsearch@44a3d98365
2017-03-22 16:33:03 +01:00
Jay Modi 85aedb6776 Cancel LDAP runnables if they are pending execution too long (elastic/x-pack-elasticsearch#727)
The LdapRealm submits runnables to the generic thread pool when a bind is necessary as a bind must
be a synchronous operation and we do not want to block network threads on this. However, the
generic threadpool could be full and this runnable could get queued. When this happens requests
appear to hang; to prevent this we submit a delayed executable that will stop the runnable from
attempting to connect to Ldap and provide an exceptional response to the listener.

relates elastic/x-pack-elasticsearch#716

Original commit: elastic/x-pack-elasticsearch@3e43b17f1d
2017-03-22 05:27:46 -07:00
Jay Modi 8ba6e8b3eb Fix merging of field level security rules (elastic/x-pack-elasticsearch#796)
This commit fixes the merging of field level security rules from multiple roles. Prior to 5.2, the
merging was treated as the merging of languages whereas after 5.2, this incorrectly became a merge
of all rules meaning a single wildcard could cause denials to be ignored.

Original commit: elastic/x-pack-elasticsearch@42f9e6d8b0
2017-03-22 05:10:30 -07:00
Martijn van Groningen 3f5d9850ae [ML] Removed public constructors for testing.
Original commit: elastic/x-pack-elasticsearch@a5d45f2b66
2017-03-22 10:52:18 +01:00
Martijn van Groningen c12d487c01 [ML] Make fields final
Original commit: elastic/x-pack-elasticsearch@49c7d79835
2017-03-22 10:46:59 +01:00
Ryan Ernst 8a8ed1cfbb Plugins: Update jarhell calls with new set based api (elastic/x-pack-elasticsearch#743)
This is the xpack side of elastic/elasticsearch#23596

Original commit: elastic/x-pack-elasticsearch@d1654b1ccd
2017-03-21 12:13:37 -07:00
Dimitris Athanasiou f7c4c754c2 [ML] Accept 'now' in start/end params of start datafeed API (elastic/x-pack-elasticsearch#784)
The params start/end of the start datafeed API now accept
'now' as a value.

Also adds a validation that start must be earlier than end.

relates elastic/x-pack-elasticsearch#781

Original commit: elastic/x-pack-elasticsearch@5396dcb5e8
2017-03-21 17:05:36 +00:00
Jay Modi 72248adcbb Asynchronous export of monitoring data (elastic/x-pack-elasticsearch#718)
This commit removes the blocking invocation of bulk requests in monitoring as in some cases this
can lead to exhaustion of the generic threadpool, which effectively prevents the node from
operating normally.

One behavior change that is made by this commit is the MonitoringService will no longer wait
indefinitely when closing as this can lead to a node blocking forever and never shutting down.
Instead a wait of 10 seconds is added, which aligns with the security index audit trail's behavior
on shutdown.

relates elastic/x-pack-elasticsearch#715

Original commit: elastic/x-pack-elasticsearch@5ba7f49aab
2017-03-21 12:15:13 -04:00
Dimitris Athanasiou 58827dd433 [ML] Do not advance time when datafeed encounters extraction problems (elastic/x-pack-elasticsearch#782)
Original commit: elastic/x-pack-elasticsearch@fcc9af6869
2017-03-21 14:50:10 +00:00
Martijn van Groningen cb5d44c9c4 [ML] Don't assign cancel holders to node tasks, but use the services that stop datafeed and jobs directly.
Relates to elastic/x-pack-elasticsearch#749

Original commit: elastic/x-pack-elasticsearch@ff074b0442
2017-03-21 15:30:13 +01:00
Martijn van Groningen 6fae1867ec [ML] Uses AbstractRunnable for running datafeed, so that we handle rejected execution exceptions.
Original commit: elastic/x-pack-elasticsearch@d04d3fa401
2017-03-21 14:18:09 +01:00
Martijn van Groningen dd91ac0cd3 [ML] Don't use default locale.
Original commit: elastic/x-pack-elasticsearch@f1e5016008
2017-03-21 13:28:11 +01:00
Martijn van Groningen 4f5b3dfea3 [ML] Set ml' tp queue sizes to a reasonable level.
Original commit: elastic/x-pack-elasticsearch@7f7b2defcd
2017-03-21 13:09:46 +01:00