Commit Graph

5420 Commits

Author SHA1 Message Date
Shaunak Kashyap 01a8f5a0b3 Document security privileges required for using Watcher (elastic/x-pack-elasticsearch#1012)
* Document security privileges required for using Watcher

* Fixing index names

* Language fixes

Original commit: elastic/x-pack-elasticsearch@56ef06d077
2017-04-11 04:22:45 -07:00
David Roberts d2c90e798f [ML] Make open/close job timeouts consistent (elastic/x-pack-elasticsearch#1039)
Before this change the persistent task operations related to opening
and closing jobs would time out a long time before the operations
related to native processes.

Original commit: elastic/x-pack-elasticsearch@23076b773b
2017-04-11 11:45:48 +01:00
Dimitrios Athanasiou 1760677b0e [ML] Remove redundant logging
Relates elastic/x-pack-elasticsearch#1027

Original commit: elastic/x-pack-elasticsearch@ddbe390e6f
2017-04-11 10:44:00 +01:00
Simon Willnauer 617c3ead5c Add tests for _remote/info API (elastic/x-pack-elasticsearch#1009)
Relates to elastic/elasticsearch#23925
Depends on elastic/elasticsearch#23969

Original commit: elastic/x-pack-elasticsearch@d1e8754a57
2017-04-11 11:24:22 +02:00
Clinton Gormley d4d505fb97 Added docs for making cross cluster search work with security
relates elastic/x-pack-elasticsearch#868

Original commit: elastic/x-pack-elasticsearch@0292fbb5d3
2017-04-11 10:08:12 +02:00
Colin Goodheart-Smithe 29c64d83e1 Removes version 2.x constants from Version (elastic/x-pack-elasticsearch#1022)
Original commit: elastic/x-pack-elasticsearch@39ef909aec
2017-04-11 08:30:59 +01:00
Tim Vernum 8840042751 Only log LDAP errors if authentication failed overall (elastic/x-pack-elasticsearch#960)
Changes the logging of LDAP authentication failures from "always" to "only if the user failed to be authenticated"

Previously there were cases (such has having 2 AD realms) where successful user authentication would still cause an INFO message to be written to the log for every request. 
Now that message is suppressed, but a WARN message is added _if-and-only-if_ the user cannot be authenticated by any realm.

This is implemented via a new value stored in the ThreadContext that the AuthenticationService choses to log (or not log) depending on the result of the authenticate process.
  
Closes: elastic/x-pack-elasticsearch#887

Original commit: elastic/x-pack-elasticsearch@b81b363729
2017-04-11 09:37:21 +10:00
Zachary Tong 43f1fb2bb1 [ML] Correctly parse stream of SMILE documents in JsonDataToProcessWriter (elastic/x-pack-elasticsearch#982)
The PR detects if SMILE is being provided, then correctly slices the stream such that each document is parsed individually. This is required because jackson's SMILE parser is stricter than it's JSON parser and will stop parsing when it hits a streamSeparator (unlike JSON, which will eagerly try to find more objects to parse).

Removes the forced-headers from the various REST tests.

relates elastic/x-pack-elasticsearch#642 

Original commit: elastic/x-pack-elasticsearch@c0e97cd545
2017-04-10 17:55:15 -04:00
Igor Motov 49223a8782 Persistent Tasks: remove listener from PersistentTasksExecutor#nodeOperation (elastic/x-pack-elasticsearch#1032)
Instead of having a separate listener for indicating that the current task is finished, this commit is switching to use allocated object itself.

Original commit: elastic/x-pack-elasticsearch@7ad5362121
2017-04-10 17:32:30 -04:00
Martijn van Groningen 018a3d197d [ML] Index job and datafeed assignment notifications via a separate cluster state listener.
`PersistentTasksExecutor#getAssignment(...)` should be a cheap and side-effect free method,
but in case of `OpenJobPersistentTasksExecutor` and `StartDatafeedPersistentTasksExecutor` before this change it would index a document each time `getAssignment(...)` was invoked

Original commit: elastic/x-pack-elasticsearch@5ca5890baf
2017-04-10 20:20:48 +02:00
Martijn van Groningen ecc19d9948 [TEST] Fixed typos in @TestLogging annotations
Original commit: elastic/x-pack-elasticsearch@3152765d4c
2017-04-10 20:13:50 +02:00
Martijn van Groningen 9201a5d640 [TEST] Changed test log levels
Original commit: elastic/x-pack-elasticsearch@73bd1251fa
2017-04-10 19:48:56 +02:00
Dimitris Athanasiou 1e1b5405b3 [ML] Also chunk aggregated datafeed by default (elastic/x-pack-elasticsearch#999)
The change applies chunking by default on aggregated datafeeds.
The chunking is set to a manual mode with time_span being
1000 histogram buckets.

The motivation for the change is two-fold:

1. It helps to avoid memory pressure/blowing.
Users may perform a lookback on a very long period of time. In that
case, we may hold a search response for all that time which could
include too many buckets. By chunking, we avoid that situation
as we know we'll only keep results for 1000 buckets at a time.

2. It makes cancellation more responsive.
In elastic/x-pack-elasticsearch#862 we made the processing of a search response cancellable in a
responsive manner. However, the search phase cannot be cancelled at
the moment. Chunking makes the search phase shorter, which will
result to a better user experience when they stop an aggregated
datafeed.

Also note the change sets the default chunking_config on datafeed
creation so the setting is no longer hidden.

Relates to elastic/x-pack-elasticsearch#803

Original commit: elastic/x-pack-elasticsearch@ae8f120f5f
2017-04-10 18:20:48 +01:00
Dimitris Athanasiou 0b6ac175da [ML] Check datafeed can be assigned before creating task (elastic/x-pack-elasticsearch#1027)
When a datafeed task is created but it cannot be assigned the task
has a null status. This means _stats report it as stopped, however
deleting it fails. In addition, it's a better experience to error
the start datafeed request all together and give the user the chance
to fix his data indices.

This change fails a datafeed-start if it cannot be assigned.

relates elastic/x-pack-elasticsearch#1018

Original commit: elastic/x-pack-elasticsearch@532288fda0
2017-04-10 18:19:46 +01:00
Igor Motov 105ba131e0 Persistent Tasks: remove retries on notification failures (elastic/x-pack-elasticsearch#977)
Retries should be already handled by TransportMasterNodeAction, there is no need to introduce another retry layer in Persistent Tasks code.

Original commit: elastic/x-pack-elasticsearch@967ac7f7fa
2017-04-10 12:26:09 -04:00
Lisa Cawley 90575b18f4 [DOCS] Add ML data feed API examples (elastic/x-pack-elasticsearch#1016)
* [DOCS] Added examples for all ML job APIs

* [DOCS] Add ML datafeed API examples

Original commit: elastic/x-pack-elasticsearch@9634356371
2017-04-10 09:06:34 -07:00
David Kyle 00bc35cf9f [ML] Consistently throw missing resource exception on all endpoints if the job id is not known. (elastic/x-pack-elasticsearch#1024)
Original commit: elastic/x-pack-elasticsearch@6676a03599
2017-04-10 15:23:08 +01:00
Tanguy Leroux 310b85083d [Test] Change how LocalExporterTests stops
This commit changes how LocalExporterTests stops the monitoring
components: it first stops the monitoring service (but keeps the
local exporter enabled), deletes and checks if monitoring indices
are recreated, and then disables the local exporter.

Original commit: elastic/x-pack-elasticsearch@4c4809a660
2017-04-10 15:14:49 +02:00
Martijn van Groningen 454d6b3390 [ML] Reintroduced the closing job state
Closing a job may take a while. In the meantime it is possible to start a datafeed, because before this change the job state remained OPENED.
With this change when the executor node receives the close job request, it will first set the status to CLOSING and after that closes the job (closing autodetect process, etc.).

relates elastic/x-pack-elasticsearch#990

Original commit: elastic/x-pack-elasticsearch@d8d89c0756
2017-04-10 15:08:50 +02:00
Tanguy Leroux 6396edc6a7 [Test] Add Monitoring Bulk API REST tests with privileges (elastic/x-pack-elasticsearch#968)
This commit removes the smoke-test-monitoring-with-security project
and replaces it with a REST test.

Original commit: elastic/x-pack-elasticsearch@f1665815c2
2017-04-10 15:08:19 +02:00
javanna 07a99c4792 [TEST] exclude num_reduce_phases from the SearchTransformTests comparisons
Original commit: elastic/x-pack-elasticsearch@d3a5c7e86b
2017-04-10 14:21:38 +02:00
David Roberts e8337344a6 [ML] Include C++ 3rd party notices in X-Pack combined NOTICES file (elastic/x-pack-elasticsearch#953)
relates elastic/x-pack-elasticsearch#620

Original commit: elastic/x-pack-elasticsearch@5d73bd340c
2017-04-10 12:40:07 +01:00
Martijn van Groningen 63c04ef19d [ML] Change close job api to no longer extend from TransportJobTaskAction.
The execution has diverged too much from post data, flush and update process apis, since the close all jobs have been added.
The logic is now easier to understand as it exist in a single source file instead of in both CloseJobAction and TransportJobTaskAction.

Original commit: elastic/x-pack-elasticsearch@daf5fabad5
2017-04-10 13:33:12 +02:00
Luca Cavanna cb07e93fde Adapt to getProperty move out of MultiBucketsAggregation.Bucket (elastic/x-pack-elasticsearch#1015)
Adapt to getProperty move out of MultiBucketsAggregation.Bucket

Original commit: elastic/x-pack-elasticsearch@3e8ca753cd
2017-04-10 13:28:37 +02:00
Tim Vernum 18835fe4df Expand debug logging for authentication / realms (elastic/x-pack-elasticsearch#641)
Users currently have difficulty diagnosing authentication failures.
Some logging messages mislead them, and in other cases there are unexpected behaviours that are not logged at all.
These additional DEBUG log messages and change some existing messages in an attempt to alleviate that problem.

Original commit: elastic/x-pack-elasticsearch@c6ea98b038
2017-04-10 21:21:40 +10:00
Luca Cavanna ef4de13ca4 Adapt ChunkedDataExtractor to removal of Aggregations#getProperty (elastic/x-pack-elasticsearch#1008)
Adapt ChunkedDataExtractor to removal of Aggregations#getProperty

Original commit: elastic/x-pack-elasticsearch@01ee2fee58
2017-04-10 12:32:11 +02:00
Martijn van Groningen 0ae0f93994 [ML] Stop immediately when job isn't opened
Original commit: elastic/x-pack-elasticsearch@cdb4cf47f5
2017-04-10 10:54:40 +02:00
Martijn van Groningen 0c2ef5608e [ML] Use same CS for validating job
Original commit: elastic/x-pack-elasticsearch@00b593e8c2
2017-04-10 10:32:42 +02:00
Dimitris Athanasiou a1cb22836c [ML] Add more categorization validations (elastic/x-pack-elasticsearch#1019)
- validates that when mlcategory is used, categorization_field_name is
set
- validates that when categorization_field_name is set, mlcategory is
used

relates elastic/x-pack-elasticsearch#986

Original commit: elastic/x-pack-elasticsearch@e861a3ed58
2017-04-09 18:18:17 +01:00
Dimitrios Athanasiou 0df726f6dd [ML] Fix logger usage
Original commit: elastic/x-pack-elasticsearch@f85148e0ff
2017-04-08 15:52:44 +01:00
Dimitrios Athanasiou 16d8dc6815 [ML] Log when no node found to open job/start datafeed
Relates elastic/x-pack-elasticsearch#878

Original commit: elastic/x-pack-elasticsearch@a64b7eaa80
2017-04-08 15:18:48 +01:00
Dimitris Athanasiou 5c9364d5fe [ML] Increase stop datafeed default timeout to 5 minutes (elastic/x-pack-elasticsearch#992)
Increase the timeout to give enough time for a datafeed to
stop smoothly.

This is the second step to avoid hitting the default timeout.
The first was ensuring aggregated datafeed is cancellable in
a responsive manner. The third and final step will be to
apply chunking in aggregated datafeeds in order to shorten
the duration of the search, which will make cancellation even
more responsive.

Relates elastic/x-pack-elasticsearch#803

Original commit: elastic/x-pack-elasticsearch@db642330ec
2017-04-08 14:44:08 +01:00
Dimitrios Athanasiou 734243a4df [TEST] Remove unused logger from CategorizationIT
Original commit: elastic/x-pack-elasticsearch@7b812eeede
2017-04-08 14:42:47 +01:00
Jay Modi cdfcfc5540 Do not contact AWS in offline mode (elastic/x-pack-elasticsearch#1001)
This commit restores the ability to build x-pack-elasticsearch without issues when running without
access to the internet. When the `--offline` flag is used, we will not try to contact vault and the
aws apis to retrieve the ml-cpp binaries but instead gradle will use a cached version even though
it may be expired.

relates elastic/x-pack-elasticsearch#726

Original commit: elastic/x-pack-elasticsearch@b0915d8fa9
2017-04-08 07:08:28 -06:00
Dimitrios Athanasiou 10df00beb1 [ML] Fix typo in assignment_explanation field name
Closes  elastic/x-pack-elasticsearch#1017

Original commit: elastic/x-pack-elasticsearch@b18e2a38fc
2017-04-08 13:17:14 +01:00
Ryan Ernst e8399cfccf Build: Build 5.x version of xpack for bwc tests to use (elastic/x-pack-elasticsearch#885)
This is analagous of the bwc-zip for elasticsearch. The one caveat is
due to the structure of how ES+xpack must be checked out, we end up with
a third clone of elasticsearch (the second being in :distribution:bwc-zip).
But the rolling upgrade integ test passes with this change.

relates elastic/x-pack-elasticsearch#870

Original commit: elastic/x-pack-elasticsearch@34bdce6e99
2017-04-07 22:19:30 -07:00
Jay Modi 984055392e Rename ml delete by query to xpack delete by query (elastic/x-pack-elasticsearch#1005)
This commit renames and moves the forked delete by query classes from being ml specific to being a
xpack common class since an upcoming security feature plans to make use of this. Additionally, this
commit fixes a issue where the dbq action was being executed by the calling user instead of the
xpack user for certain requests. This was found when adding a authorization change that restricts
this action's execution to the xpack user only.

Original commit: elastic/x-pack-elasticsearch@d5967e7255
2017-04-07 19:06:01 -06:00
debadair 40fc8058e5 [DOCS] Fixed includes to correctly reference other repos.
Original commit: elastic/x-pack-elasticsearch@f6a0d09575
2017-04-07 17:32:03 -07:00
Tanguy Leroux 9246261bc5 [Test] Generate less fields in LocalExporterTests
The test creates random documents, it looks like it generates too
   many fields.

Original commit: elastic/x-pack-elasticsearch@f55a3d1fc7
2017-04-07 20:47:40 +02:00
Dimitrios Athanasiou 54b72dc938 [TEST] Add ML categorization integ test
Original commit: elastic/x-pack-elasticsearch@ba8c2a1d64
2017-04-07 18:46:01 +01:00
David Roberts b9941de39d [TEST] Fix some assertions to match prior code change
Original commit: elastic/x-pack-elasticsearch@be4cc9cbef
2017-04-07 18:01:32 +01:00
Zachary Tong 8e2e26fc44 [ML] Forbid 'by' and 'over' as fieldnames for by/over (elastic/x-pack-elasticsearch#1007)
relates elastic/x-pack-elasticsearch#1002

Original commit: elastic/x-pack-elasticsearch@ba9005a58e
2017-04-07 16:09:22 +00:00
Dimitris Athanasiou bf111dde7e [ML] Add notification when no suitable nodes exist to allocate job (elastic/x-pack-elasticsearch#1006)
Relates elastic/x-pack-elasticsearch#878

Original commit: elastic/x-pack-elasticsearch@5a96484662
2017-04-07 16:55:10 +01:00
David Roberts 3986235d93 [ML] Fix large state persistence performance (elastic/x-pack-elasticsearch#1004)
There was a problem with the way CompositeBytesReference was used in the
StateProcessor.  In the case of a large state document we ended up with a
deeply nested CompositeBytesReference that then caused a deep stack and N^2
processing in the bulk action processor.

This change uses an intermediate list of byte arrays that get combined into
a single CompositeBytesReference to avoid the deep nesting.

Additionally, errors in state processing now bubble up to close the state
stream, which will cause the C++ process to stop trying to persist more state.

Finally, the results processor also times out after a similar period (30 minutes)
to that used by the state processor.

Original commit: elastic/x-pack-elasticsearch@ceb31481d1
2017-04-07 15:57:21 +01:00
Brandon Kobel fbefaf5b6d Adding xpack.reporting.index to the reporting-settings (elastic/x-pack-elasticsearch#1000)
* Adding xpack.reporting.index to the reporting-settings

* Fixing text size

Original commit: elastic/x-pack-elasticsearch@334274e49d
2017-04-07 10:01:02 -04:00
Hendrik Muhs c7fd1aacff [ML] implement _all for closing jobs (elastic/x-pack-elasticsearch#962)
Add a '_all' functionality for closing ML jobs.

For cluster shutdown due to maintenance and major upgrades we recommend the user to stop all datafeeds and jobs. This change add the ability to close all jobs at once where previously it was required to iterate over all jobs and do a explicit close. This is part one of elastic/x-pack-elasticsearch#795, part two can be found in elastic/x-pack-elasticsearch#995.

relates elastic/x-pack-elasticsearch#795

Original commit: elastic/x-pack-elasticsearch@9b251ed7e1
2017-04-07 14:51:13 +02:00
Dimitrios Athanasiou b41288592c [ML] Some logging improvements
- Downgrade flush logging as it's called too often from datafeeds
- Add log info for job opening

Original commit: elastic/x-pack-elasticsearch@a262069f78
2017-04-07 13:36:04 +01:00
Adrien Grand df3cc61c5b Mute ActivateWatchTests.testDeactivateAndActivate.
Relates elastic/x-pack-elasticsearch#395

Original commit: elastic/x-pack-elasticsearch@bdf5a0dfed
2017-04-07 11:03:31 +02:00
Martijn van Groningen d8170861ea [TEST] Check whether datafeed is stopped differently
Original commit: elastic/x-pack-elasticsearch@9bde2cc2c2
2017-04-07 10:50:48 +02:00
Martijn van Groningen b248b6dbfc [TEST] [ML] Run ensureStableCluster(...) on all nodes and run synched flush before executing the disrupt
Original commit: elastic/x-pack-elasticsearch@d10beacb73
2017-04-07 09:51:13 +02:00