Commit Graph

51479 Commits

Author SHA1 Message Date
Nhat Nguyen b1136948b4 Mute CancellableTasksIT.testDoNotWaitForCompletion 2020-04-29 18:13:03 -04:00
Lisa Cawley 5100fd7eb2
[DOCS] Add token based authn documentation (#55957) 2020-04-29 14:47:02 -07:00
Dan Hermann bf89e485fc
[7.x] Delete index API properly handles backing indices for data streams (#55971) 2020-04-29 16:32:59 -05:00
Mark Vieira 07a3d808ee
Add build scan tag when running in FIPS mode (#55960) 2020-04-29 14:30:07 -07:00
Christos Soulios 43dab77186
[7.x] Modified searchAndReduce() to return empty agg when no docs exist (#55967)
Backports #55826 to 7.x

    Modified AggregatorTestCase.searchAndReduce() method so that it returns an empty aggregation result when no documents have been inserted.

    Also refactored several aggregation tests so they do not re-implement method AggregatorTestCase.testCase()

    Fixes #55824
2020-04-30 00:28:32 +03:00
Przemko Robakowski bf0204ba06
Fix empty_value handling in CsvProcessor (#55649) (#55968)
* Fix empty_value handling in CsvProcessor

Due to bug in `CsvProcessor.Factory` it was impossible to specify `empty_value`.
This change fixes that and adds relevant test.

Closes #55643

* assert changed
2020-04-29 22:37:22 +02:00
Mark Tozzi 9cd3175bbb
[7.x] Wire up AutoDateHistogram to the ValuesSourceRegistry (#55687) (#55870) 2020-04-29 16:26:09 -04:00
jimczi 86ee8974d0 Revert "Mute failing tests in AsyncSearchActionIT"
This reverts commit 2fe4801ca1.
2020-04-29 22:22:21 +02:00
Nhat Nguyen c547a92ac6 Revert "Mute CancellableTasksIT.testDoNotWaitForCompletion"
This reverts commit 0c095bbd0c.
2020-04-29 16:21:42 -04:00
Mark Vieira 0c095bbd0c
Mute CancellableTasksIT.testDoNotWaitForCompletion 2020-04-29 12:59:07 -07:00
Nhat Nguyen edbaa19a5d Add trace log for task cancellation (#55940)
Adding trace logs to the task cancellation and its tests 
to debug the test failure in #55875.

Relates ##55875
2020-04-29 15:37:37 -04:00
Mark Vieira 144e8ce092
Update Lucene version for Elasticsearch 6.8.9 (#55963) 2020-04-29 12:36:37 -07:00
Mark Vieira 2fe4801ca1
Mute failing tests in AsyncSearchActionIT 2020-04-29 10:59:10 -07:00
Dimitris Athanasiou c5aa281171
[7.x][ML] Remove error on parsing progress for unknown phase in DFA (#55926) (#55954)
On second thought, this check does not seem to be adding value.
We can test that the phases are as we expect them for each analysis
by adding yaml tests. Those would fail if we introduce new phases
from c++ accidentally or without coordination. This would achieve
the same thing. At the same time we would not have to comment out
this code each time a new phase is introduced. Instead we can just
temporarily mute those yaml tests. Note I will add those tests
right after the imminent new phases are added to the c++ side.

Backport of #55926
2020-04-29 20:11:33 +03:00
Tim Brooks 9eb6736500
Fix NullPointer when message shortcircuited (#55945)
Currently if we shortcircuit a message the breaker release is null since
there is nothing to be broken. However, the TcpTransportChannel
infrastructure still expects it. This commit resolves this issue be
returning a no-op breaker release.
2020-04-29 10:11:39 -06:00
Benjamin Trent edd049f9cd
[ML] Allow a certain number of ill-formatted rows when delimited format is specified (#55735) (#55944)
While it is good to not be lenient when attempting to guess the file format, it is frustrating to users when they KNOW it is CSV but there are a few ill-formatted rows in the file (via some entry error, etc.).

This commit allows for up to 10% of sample rows to be considered "bad". These rows are effectively ignored while guessing the format.

This percentage of "allows bad rows" is only applied when the user has specified delimited formatting options. As the structure finder needs some guidance on what a "bad row" actually means.

related to https://github.com/elastic/elasticsearch/issues/38890
2020-04-29 11:15:21 -04:00
Christoph Büscher 57409fccbd Remove unnecessary instance variable in QueryStringQueryParser (#55915)
Currently `currentFieldType` is an instance variable that is first set and then
used by all methods referring to it. We can make it local to each method
instead, avoiding possible state problems and improve readability of the code
instead.
2020-04-29 16:30:48 +02:00
James Rodewig 65b47d20a6 [DOCS] Update attribute for multi arg footnotes (#55860) 2020-04-29 10:25:36 -04:00
James Rodewig 0cb5404925
[DOCS] Add Zabbix monitoring template to community monitoring integrations (#55782)
Co-authored-by: RogerTheUnicornHive <laris2@gmail.com>
2020-04-29 10:14:49 -04:00
James Rodewig 1808a1f36b [DOCS] EQL: Correct `cidrMatch` function heading (#55935) 2020-04-29 10:02:06 -04:00
Andrei Dan 6b886b0b7a
[7.x] Add simulate template composition API _index_template/_simulate_index/{name} (#55686) (#55922)
This adds a new api to simulate matching the given index name against the
 index templates in the system.

The syntax for the new API takes the following form:

POST _index_template/_simulate_index/{index_name}
{
  "index_patterns": ["logs-*"],
  "priority": 15,
  "template": {
	"settings": {
		"number_of_shards": 3
	}
       ...
   }
}

Where the body is optional, but we support the entire body used by the
PUT _index_template/{name} api. When the body is specified we'll simulate
matching the given index against a system that'd have the given index
template together with the index templates that exist in the system.

The response, in both cases, will return the matching template's resolved
settings, mappings and aliases, together with a special field that'll print any
overlapping templates and their corresponding index patterns.

(cherry picked from commit 1a5845edce1f445c58e094e9a3b6792e21e543b0)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
2020-04-29 14:57:44 +01:00
István Zoltán Szabó 337dc45f5b [DOCS] Adds missing space and a relevant link to the slm execute API page (#55917)
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-04-29 15:50:06 +02:00
Jim Ferenczi 293c81dd59 Fix AsyncSearchActionIT#testTermsAggregation (#55924)
This commit fixes the initialization of total hits
in the async search response.

Relates #55683
Closes #55920
2020-04-29 15:44:10 +02:00
Jake Landis ae4d980c8c
[7.x] json spec - add description for autoscaling (#55748) (#55901) 2020-04-29 08:40:11 -05:00
James Rodewig bbf68de446 [DOCS] Correct Lucene link in `kstem` token filter docs 2020-04-29 09:30:37 -04:00
Luca Cavanna 8b05027bf0 [DOCS] Clarify async search response flags (#55574)
Relates to #55572
2020-04-29 15:22:05 +02:00
David Turner 5ca511622f
Add API specs for voting config exclusions (#55919)
Closes #48131
Backport of #55760

Co-authored-by: zacharymorn <zacharymorn@gmail.com>
2020-04-29 14:00:36 +01:00
James Rodewig 767836c367
[DOCS] Reformat `kstem` token filter (#55823)
Makes the following changes to the `kstem` token filter docs:

* Rewrite description and adds a Lucene work
* Adds detailed analyze example
* Adds an analyzer example
2020-04-29 08:52:55 -04:00
Andrei Dan 6a0e1e161b
ILM stop step execution if writeIndex is false (#54805) (#55923)
(cherry picked from commit 47a9fd760f7bf2cc6cd778485dc057b6aaf07709)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
2020-04-29 13:39:37 +01:00
Christos Soulios 02bf0c586a
[7.x] Histogram field type support for Sum aggregation (#55916)
Implements Sum aggregation over Histogram fields by summing the value of each bucket multiplied by their count as requested in #53285

Backports #55681 to 7.x
2020-04-29 15:06:12 +03:00
Henning Andersen f679880b80 [DOCS] Create index name required (#55886)
The name of the new index to create is required.

Relates #45749
2020-04-29 13:35:49 +02:00
David Roberts 6ad497bfda Muting AsyncSearchActionIT.testTermsAggregation
Due to https://github.com/elastic/elasticsearch/issues/55920
2020-04-29 12:34:47 +01:00
Yang Cheng 06b3345787 Avoid double-recovery when state recovery delayed
Today if state recovery is delayed by the `gateway.recover_after_*` settings
then we may end up performing state recovery twice: once when enough nodes have
joined the cluster, and again when the timeout elapses. The second state
recovery reinitializes the routing table, effectively discarding all
recovered/recovering shards and starting again from scratch. This commit adds a
check to prevent this second state recovery.

Closes #55564
2020-04-29 11:55:28 +01:00
Dimitris Athanasiou d9685a0f19
[7.x][ML] Validate at least one feature is available for DF analytics (#55876) (#55914)
We were previously checking at least one supported field existed
when the _explain API was called. However, in the case of analyses
with required fields (e.g. regression) we were not accounting that
the dependent variable is not a feature and thus if the source index
only contains the dependent variable field there are no features to
train a model on.

This commit adds a validation that at least one feature is available
for analysis. Note that we also move that validation away from
`ExtractedFieldsDetector` and the _explain API and straight into
the _start API. The reason for doing this is to allow the user to use
the _explain API in order to understand why they would be seeing an
error like this one.

For example, the user might be using an index that has fields but
they are of unsupported types. If they start the job and get
an error that there are no features, they will wonder why that is.
Calling the _explain API will show them that all their fields are
unsupported. If the _explain API was failing instead, there would
be no way for the user to understand why all those fields are
ignored.

Closes #55593

Backport of #55876
2020-04-29 11:39:58 +03:00
David Roberts 61ac09ae21
[ML] Add daily_model_snapshot_retention_after_days to job config (#55891)
This change adds a new setting, daily_model_snapshot_retention_after_days,
to the anomaly detection job config.

Initially this has no effect, the effect will be added in a followup PR.
This PR gets the complexities of making changes that interact with BWC
over well before feature freeze.

Backport of #55878
2020-04-29 09:12:53 +01:00
István Zoltán Szabó e982cf4381 [DOCS] Makes the footnotes less verbose in configuring aggs page. (#55857) 2020-04-29 09:52:29 +02:00
Armin Braun b96db2ee2b
Increase Timeout in ClusterDisruptionIT.testRestartNodeWhileIndexing (#55877) (#55880)
The test failed in #55869 but the `docId` was never stuck, it just moved slowly upwards.
=> increasing to timeout.

Closes #55869
2020-04-29 06:47:00 +02:00
debadair 8a662c7e62
ILM update backports (#55902)
* [DOCS] Rework conceptual info for ILM. (#52181)

* [DOCS] Rework conceptual info for ILM.

* Split the actions out of concepts.

* Added xpack role to actions.

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>

* Apply suggestions from code review

* Edit actions for consistency and add action template. (#55632)

* Edit actions for consistency and add action template.

* Update docs/reference/ilm/actions/ilm-readonly.asciidoc

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>

* Apply suggestions from code review
2020-04-28 16:38:01 -07:00
Tim Brooks 8d1595698b
Improve start_recovery check in IndexRecoveryIT (#55867)
Currently the testTransientErrorsDuringRecoveryAreRetried validates that
the expected peer recovery starts only once. This check is coarse and is
executed on all nodes and indexes. This commit modifies this check to
only be performed on the expected index. Additionally this commit
removes the disruption behavior from the "blue" node where it is not
relevant. Finally, this commit improves the logging for this test.
2020-04-28 16:40:03 -06:00
Lee Hinman 4315a55a1c
[7.x] Initial documentation for index templates V2 (#55755) (#55898)
Backports the following commits to 7.x:
 - Initial documentation for index templates V2 (#55755)
2020-04-28 16:10:50 -06:00
Ryan Ernst f8db1a56f8
Guard java9+ warn option in test config 2020-04-28 14:32:40 -07:00
Ryan Ernst 3f1a983ecb
Fix spotless...whitespace 2020-04-28 14:10:10 -07:00
Ryan Ernst 07f8c0368e
Split java plugin elements out of BuildPlugin (#55834)
BuildPlugin is a catch all for any elasticsearch common build
infrastructure. Unfortunately that makes reusing parts of it difficult.
This commit splits the parts specific to all java based projects out to
our own elasticsearch.java plugin.
2020-04-28 13:50:40 -07:00
Nik Everett a5d0409a8f
Save memory in on aggs in async search (#55683) (#55879)
This replaces a reference to the result of partially reducing
aggregations that async search keeps with a reference to the serialized
form of the result of the partial reduction which we need to keep
anyway.
2020-04-28 16:23:30 -04:00
Ryan Ernst fed296ebb7
Add method to check if object is generically writeable in stream (#54936) (#55561)
When calling scripts in metric aggregation, the returned metric state is
passed along to the coordinating node to do the final reduce. However,
it is possible the object could contain nested state which is unknown to
StreamOutput/StreamInput. This would then result in the node crashing as
exceptions are not expected in the middle of serialization.

This commit adds a method to StreamOutput that can determine if an
object is writeable by the stream. It uses the same logic
writeGenericValue, special casing each of the supported collection types
to recursively determine if each contained value is itself writeable.

relates #54708
2020-04-28 13:08:41 -07:00
Tim Brooks 9e376589a6
Fully stop RetryableAction when cancelled (#55614)
Currently cancelling the RetryableAction does not stop one last run from
being executed. This commit makes a best effort attempt to cancel a
scheduled retry and guards future executions from the action already
being completed.
2020-04-28 13:54:00 -06:00
Tim Brooks cd228095df
Retry failed peer recovery due to transient errors (#55883)
Currently a failed peer recovery action will fail an recovery. This
includes when the recovery fails due to potentially short lived
transient issues such as rejected exceptions or circuit breaking
errors.

This commit adds the concept of a retryable action. A retryable action
will be retryed in face of certain errors. The action will be retried
after an exponentially increasing backoff period. After defined time,
the action will timeout.

This commit only implements retries for responses that indicate the
target node has NOT executed the action.
2020-04-28 13:52:49 -06:00
Lee Hinman 1c73fcfc86
Mark ITv2 APIs as experimental (#55874)
This commit marks the V2 index and component template APIs experimental, with intent to mark them as
"stable" in 7.9.0.

Relates to #53101
2020-04-28 11:27:34 -06:00
Nhat Nguyen ad6221c0cb Fix testKeepTranslogAfterGlobalCheckpoint (#55868)
If we advance the global checkpoint during commit and sync that
checkpoint after commit, then the assertions in the test won't hold
because the deletion policy did not see the latest global checkpoint
but only the value before committing.

Closes #55680
2020-04-28 12:50:41 -04:00
Henning Andersen cab7bcc156
Disk decider respect watermarks for single data node (#55805) (#55847)
The disk decider had special handling for the single data node case,
allowing any allocation (skipping watermark checks) for such clusters.
This special handling can now be avoided via a setting.
2020-04-28 18:46:22 +02:00