Commit Graph

685 Commits

Author SHA1 Message Date
Ryan Ernst aae7cf0b0f Update test script engines to use generic compile method (elastic/x-pack-elasticsearch#1546)
This is the xpack side of https://github.com/elastic/elasticsearch/pull/24873

Original commit: elastic/x-pack-elasticsearch@1779afa6bc
2017-05-24 20:06:51 -07:00
Ryan Ernst 3b58334efb Refactor script context generic types (elastic/x-pack-elasticsearch#1547)
This is the xpack side of
https://github.com/elastic/elasticsearch/pull/24877

Original commit: elastic/x-pack-elasticsearch@4f3a1a27e6
2017-05-24 19:20:59 -07:00
Alexander Reelsen 463c337d62 Tests: Ensure HTTPClient does not follow redirects after post
Relates elastic/x-pack-elasticsearch#470

Original commit: elastic/x-pack-elasticsearch@5333a65c0e
2017-05-24 23:46:14 +02:00
Ryan Ernst 9a7c28786a Scripting: Use type aware script contexts (elastic/x-pack-elasticsearch#1538)
This creates two different script contexts for watcher, one which may be
used for SearchScript, and another for ExecutableScript.
This is the xpack side of elastic/elasticsearch#24868.

Original commit: elastic/x-pack-elasticsearch@9ae3d45fed
2017-05-24 14:29:25 -07:00
Dimitris Athanasiou d7e528f7f7 [ML] Reject put datafeed for job that is marked as deleted (elastic/x-pack-elasticsearch#1537)
Deleting a job issues 2 cluster state updates.
The first marks the job as deleted.
The second actually removes the job.
Both check that there is no datafeed referring to the job.
If a put datafeed request arrives between those 2 cluster
state updates, the datafeed gets created and the final
job cluster state update fails. This means we end up with
both the job and the datafeed, but the job's results and
state have been deleted.

This commit changes the behaviour so that the put
datafeed request fails for a job that is marked as deleted
as this scenario is avoiding partially executing an action.

relates elastic/x-pack-elasticsearch#1510 

Original commit: elastic/x-pack-elasticsearch@76fa0f0b1a
2017-05-24 18:34:03 +01:00
Alexander Reelsen ccf3fa2579 Watcher: Muting failing BootStrapTests.testTriggeredWatchLoading test
Relates elastic/x-pack-elasticsearch#1309

Original commit: elastic/x-pack-elasticsearch@ed03afc4d1
2017-05-24 14:55:39 +02:00
Dimitris Athanasiou 71fe599592 [ML] Single doc type for results index (elastic/x-pack-elasticsearch#1528)
This commit changes all results to use the single doc type.
All searches were adjusted to work without the need to specify
type which ensures BWC with 5.4 results.

Additional work is needed to put the new doc mapping in indices
created with 5.4 but it will be done in separate PR.

Relates elastic/x-pack-elasticsearch#668

Original commit: elastic/x-pack-elasticsearch@041c88ac2d
2017-05-24 13:24:32 +01:00
Alexander Reelsen 3d057991e0 Tests: Various watcher test improvements
* Reduced a longish timeout to a shorter one, as a watch should be
  executed in a HTTP test.
* Ensured that the TimeThrottleIntegration tests only query for own
  watches in the watch history, also use random names for watch ids
* HipChatServiceTests configured deprecated logging package, so it was
  not possible to follow the HTTP calls to the hipchat service endpoint.

relates elastic/x-pack-elasticsearch#1514
Relates elastic/x-pack-elasticsearch#1515

Original commit: elastic/x-pack-elasticsearch@adb492e4e9
2017-05-24 14:08:02 +02:00
David Kyle caad9035fd Mark failing test AwaitsFix
Original commit: elastic/x-pack-elasticsearch@c117ef9947
2017-05-24 12:25:34 +01:00
David Kyle b083062689 [ML] Add document type to ID (elastic/x-pack-elasticsearch#1525)
* Add document type to ID

* Delete v5.4 quantiles

Original commit: elastic/x-pack-elasticsearch@d1f383b972
2017-05-24 11:43:25 +01:00
David Kyle fc2d1266f4 Fix compilation
Original commit: elastic/x-pack-elasticsearch@6d34ac5a0c
2017-05-24 10:04:08 +01:00
David Kyle d9882be292 [ML] Use unique and predictable IDs for result docs (elastic/x-pack-elasticsearch#1521)
* Remove sequenceNum from anomaly records and influencers

* Generate unqiue IDs without sequence numbers

* Remove more instances of sequence_num

* Handle parsing sequnce_num from v5.4

Original commit: elastic/x-pack-elasticsearch@e60b206daf
2017-05-24 09:59:17 +01:00
Ryan Ernst b664e66a0d Test: Simplify watch stats test script engine (elastic/x-pack-elasticsearch#1520)
This commit simplifies the WatchStatsTests to use a MockScriptPlugin.
The latch script engine previously depended on a static instance of the
engine to contain the latches. These are now moved to statics of the
test class itself.

Original commit: elastic/x-pack-elasticsearch@4170cd1bd3
2017-05-23 12:23:05 -07:00
Andrew Cholakian ae778cc66f Move logstash-states template into the main logstash template (elastic/x-pack-elasticsearch#1490)
This is a revert of elastic/x-pack-elasticsearch@1940d79d13.
and also moves the template to boot

Original commit: elastic/x-pack-elasticsearch@434183b0e9
2017-05-23 09:20:46 -05:00
Jason Tedor 275bfc0e51 Mark failing exporter template test as awaits fix
This test is failing for eleven days and needs to be looked at.

Original commit: elastic/x-pack-elasticsearch@b16b95f333
2017-05-23 09:48:21 -04:00
David Kyle ea0f3fe4a0 [ML] Wait for a stopping datafeed (elastic/x-pack-elasticsearch#1461)
* [ML] Wait for a stopping datafeed

* Fix compilation after rebase

* Address review comments

Original commit: elastic/x-pack-elasticsearch@2baed641e9
2017-05-23 14:31:19 +01:00
Ali Beyad ec175debd0 Enables security to work with index aliases (elastic/x-pack-elasticsearch#1496)
This commit enables security to work with an index named .security (as
it could before) OR an alias named .security that points to a concrete
index by a different name that has the security index.  This prepares
the ability to migrate from a 5.x to 6.x security index that allows
changing and re-indexing the underlying security index while maintaining
a .security alias that points to the underlying updated index.

relates elastic/x-pack-elasticsearch#1216

Original commit: elastic/x-pack-elasticsearch@9fee12e5a0
2017-05-23 09:10:06 -04:00
Alexander Reelsen 521b7a1940 Watcher: Support setting of markdown in attachments (elastic/x-pack-elasticsearch#1492)
Watcher: Support setting of markdown in attachments

This allows to set the `mrkdwn_in` array in slack attachments to specify which fields should contain markdown.
See https://api.slack.com/docs/message-formatting#message_formatting

This is mainly useful for the text and pretext fields in an attachment.

relates elastic/x-pack-elasticsearch#403

Original commit: elastic/x-pack-elasticsearch@ee4180e4bf
2017-05-23 13:33:00 +02:00
David Roberts e198845614 [ML] Avoid masses of log spam/stack traces on shutdown (elastic/x-pack-elasticsearch#1495)
Suppress many job/datafeed errors if a node is known to be shutting down. Also, ensure started datafeeds and open jobs don't end up stopped/failed due to errors as the shutdown progresses, as this would prevent them automatically relocating to a different node.

relates elastic/x-pack-elasticsearch#1114

Original commit: elastic/x-pack-elasticsearch@e56a7dbea1
2017-05-23 10:05:27 +01:00
Ali Beyad 958ee95f26 [TEST] mute watcher test failure that is being tracked in elastic/x-pack-elasticsearch#1517
Original commit: elastic/x-pack-elasticsearch@a28b7ce3a5
2017-05-22 22:01:31 -04:00
Ryan Ernst 68e0bc419a Use simplified ScriptContext (elastic/x-pack-elasticsearch#1502)
This is the xpack side of elastic/elasticsearch#24818

Original commit: elastic/x-pack-elasticsearch@0edbbab431
2017-05-22 13:11:23 -07:00
Ali Beyad f158be89b8 [TEST] fixes tests that attempt to delete documents from missing
indices, as that is now prohibited by elastic/elasticsearch#24518

relates elastic/x-pack-elasticsearch#1511

Original commit: elastic/x-pack-elasticsearch@026a516196
2017-05-22 13:16:53 -04:00
Ali Beyad e0a8881cfc [TEST] mute failing tests, which are tracked in elastic/x-pack-elasticsearch#1511
Original commit: elastic/x-pack-elasticsearch@e23dd847f3
2017-05-22 12:19:56 -04:00
Dimitris Athanasiou aff8258398 [ML] Change result index searches to not use _type (elastic/x-pack-elasticsearch#1509)
Adjusts the searches for

- buckets
- categories
- model snapshots

to not use _type.

Relates elastic/x-pack-elasticsearch#668

Original commit: elastic/x-pack-elasticsearch@8269609705
2017-05-22 14:44:39 +01:00
Hendrik Muhs edc299a532 move verification so that test is in order (elastic/x-pack-elasticsearch#1504)
improves test by taking order of statuses into account

Original commit: elastic/x-pack-elasticsearch@0d214714d3
2017-05-22 15:44:09 +02:00
David Kyle 1873624a18 Fix failing line length checks
Original commit: elastic/x-pack-elasticsearch@6a493a70a4
2017-05-22 12:39:51 +01:00
David Kyle 8e890d0365 Fix test
Original commit: elastic/x-pack-elasticsearch@cdf7950d3f
2017-05-22 12:36:15 +01:00
David Kyle 0425f58d80 [ML] Give test jobs meaningful names (elastic/x-pack-elasticsearch#1508)
Original commit: elastic/x-pack-elasticsearch@97bec3b1e9
2017-05-22 12:22:39 +01:00
David Roberts 5b2ef6e98e [ML] Ignore IndexNotFoundException when deleting quantiles (elastic/x-pack-elasticsearch#1507)
Relates elastic/elasticsearch#24518

Original commit: elastic/x-pack-elasticsearch@34ee52443c
2017-05-22 11:04:27 +01:00
Hendrik Muhs 527dcfd98d [ML] Make job closing robust against crashes in autodetect and other misbehavior (elastic/x-pack-elasticsearch#1480)
Set job to failed if autodetect manager fails closing, fix force closing of jobs that hang in closing 
state, set timeout when waiting for clusterstate update, disallow closing of failed jobs with normal 
close

relates elastic/x-pack-elasticsearch#1453 

Original commit: elastic/x-pack-elasticsearch@493cf85e22
2017-05-22 08:48:33 +02:00
Simon Willnauer 392e67851e Preserve aliases in index permissions (elastic/x-pack-elasticsearch#1501)
Aliases might be contained in requests that check index permissions
to disable caches etc. This commit preserves permissions for
aliases as well.

Original commit: elastic/x-pack-elasticsearch@233195aeba
2017-05-20 21:34:38 +02:00
Ryan Ernst 883f5d8a7a Remove overrides of isInlineScriptEnabled (elastic/x-pack-elasticsearch#1500)
This is the xpack side of elastic/elasticsearch#24815

Original commit: elastic/x-pack-elasticsearch@5aa314a49d
2017-05-20 12:01:34 -07:00
David Roberts fa95474ab8 [BUILD] Change ordering of Java compilation and ML C++ notice extraction
May help to avoid problems with the speed of temporary AWS credentials
propagation (see elastic/x-pack-logstash#73)

Original commit: elastic/x-pack-elasticsearch@c78e00cda5
2017-05-19 13:36:40 +01:00
Tim Vernum b689159077 [TEST] Mock getVersion on channel for ServerTransportFilterTests
Original commit: elastic/x-pack-elasticsearch@0b48c21eb0
2017-05-19 10:15:49 +10:00
Jack Conradson b92a2f6582 Remove deprecated script settings. (elastic/x-pack-elasticsearch#1469)
Original commit: elastic/x-pack-elasticsearch@069e5a1087
2017-05-18 13:32:57 -07:00
Jay Modi 667f842f92 Fix authentication forward compatibility (elastic/x-pack-elasticsearch#1481)
The authentication object was changed in 5.4.0 in that it was conditionally signed depending on
the version and other factors. A bug was introduced however that causes the authentication to
actually get written with the version of the node it is being sent to even if that version is
greater than the version of the current node, which causes rolling upgrades to fail.

Original commit: elastic/x-pack-elasticsearch@a718ff8a52
2017-05-18 15:30:53 -04:00
David Kyle e5810f894c [ML] Catch exceptions in AutoDetectResultProcessor#process and continue (elastic/x-pack-elasticsearch#1484)
Original commit: elastic/x-pack-elasticsearch@f1f6a322e0
2017-05-18 18:40:41 +01:00
Dimitris Athanasiou 1bb7651dba [ML] Refactor filters API to not use _type (elastic/x-pack-elasticsearch#1483)
- Removes dependence on _type for filters.
- Changes the put filter API to take the id in the URI
- Prepares .ml-meta index to be able to host more types in future

Relates elastic/x-pack-elasticsearch#668

Original commit: elastic/x-pack-elasticsearch@d4cffa9382
2017-05-18 18:09:20 +01:00
David Kyle f3c94915b0 [ML] Add sort parameter for get buckets (elastic/x-pack-elasticsearch#1464)
* Add sort parameter for get buckets

* Add secondary sort by time

* Use default values from actions in rest requests

Original commit: elastic/x-pack-elasticsearch@a530c0bed6
2017-05-18 16:40:54 +01:00
Alexander Reelsen 3f68b4facd Watcher: Use existing plugin hook to delete all old templates (elastic/x-pack-elasticsearch#1425)
This commit ensures the old 5.x index templates are removed
using the existing plugin hook, instead of the self written part.

Original commit: elastic/x-pack-elasticsearch@6faf08d98d
2017-05-18 14:21:27 +02:00
Alexander Reelsen 55359433ae Watcher: Return proper GetWatchResponse if watcher index is missing (elastic/x-pack-elasticsearch#1462)
This ensures that the same responses is returned, when a watch is
missing and when the whole watch index is missing for the
GetWatchResponse.

relates elastic/x-pack-elasticsearch#1409

Original commit: elastic/x-pack-elasticsearch@88a7335fa9
2017-05-18 14:19:18 +02:00
Alexander Reelsen adf480f8fd Watcher: Rename watch and triggered watch types to `doc (elastic/x-pack-elasticsearch#1414)
Note: This disables the BWC tests until the upgrade API is here

Original commit: elastic/x-pack-elasticsearch@8011fa06e3
2017-05-18 11:46:03 +02:00
Ryan Ernst 4c3e82604d Convert native script uses to mock scripts (elastic/x-pack-elasticsearch#1465)
This is the xpack side of elastic/elasticsearch#24726

Original commit: elastic/x-pack-elasticsearch@0428fe1d16
2017-05-17 14:56:59 -07:00
Ryan Ernst f7705eac86 Remove file scripts (elastic/x-pack-elasticsearch#1399)
This is the xpack side of elastic/elasticsearch#24627


Original commit: elastic/x-pack-elasticsearch@4d1c745d74
2017-05-17 14:42:46 -07:00
Ryan Ernst 573da95e26 Use new wireCompatVersions property instead of bwcVersion (elastic/x-pack-elasticsearch#1466)
This is the xpack side of elastic/elasticsearch#24748

Original commit: elastic/x-pack-elasticsearch@8b7dd5cdbe
2017-05-17 12:58:51 -07:00
Dimitrios Athanasiou 05daaa8a3c [ML] Fix compilation errors after Version changes
Original commit: elastic/x-pack-elasticsearch@745c1dffac
2017-05-17 18:32:47 +01:00
Dimitrios Athanasiou 646a3acd56 [ML] Fix line width in OpenJobAction
Original commit: elastic/x-pack-elasticsearch@0798745449
2017-05-17 18:14:03 +01:00
Dimitris Athanasiou f0cb7b816d [ML] Add compatibility checks while opening a job (elastic/x-pack-elasticsearch#1458)
This commit adds compatibility checks while opening a job:

- Checks that jobs without versions (< 5.5) are not opened
- Checks that jobs with incompatible types are not opened

Original commit: elastic/x-pack-elasticsearch@a3adab733e
2017-05-17 18:10:36 +01:00
Simon Willnauer d2e1b31bc7 Fix static / version based BWC tests (elastic/x-pack-elasticsearch#1456)
With the leniency in Version.java we missed to really setup BWC
testing for static indices. This change brings back the testing and adds
missing bwc indices.

Relates to elastic/elasticsearch#24732

Original commit: elastic/x-pack-elasticsearch@85e6270338
2017-05-17 17:28:35 +02:00
Dimitrios Athanasiou b9ccee8731 [TEST] Rename remaining yaml tests to yml
Original commit: elastic/x-pack-elasticsearch@5ee8b9ab7b
2017-05-17 15:59:51 +01:00