Commit Graph

1859 Commits

Author SHA1 Message Date
David Harsha ed7a65e053
Allow specifying index in pinned queries (#74873)
The current `ids` option doesn't allow pinning a specific document in a
single index when searching over multiple indices. This introduces a
`documents` option, which is an array of `_id` and `_index`
fields to allow index-specific pins.

Closes https://github.com/elastic/elasticsearch/issues/67855.
2021-07-27 15:55:07 +03:00
Nikita Glashenko 1db17ada95
Fix wrong error upper bound when performing incremental reductions (#43874)
When performing incremental reductions, 0 value of docCountError may mean that 
the error was not previously calculated, or that the error was indeed previously 
calculated and its value was 0. We end up rejecting true values set to 0 this 
way. This may lead to wrong upper bound of error in result. To fix it, this PR 
makes docCountError nullable. null values mean that error was not calculated 
yet.

Fixes #40005

Co-authored-by: Igor Motov <igor@motovs.org>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-07-22 08:18:24 -10:00
Lyudmila Fokina 063a1f2d30
Filter out CA PrivateKeyEntry when creating a KeyManager (#73807)
In 8.0, with security on by default, we store the HTTP
layer CA PrivateKeyEntry in the http.ssl keystore (along
with the node certificate) so that it is available in our
Enrollment API transport actions.
When loading a keystore, the current behavior is that the
X509ExtendedKeyManager will iterate through the PrivateKeyEntry
objects and will return the first key/certificate that satisfies
the requirements of the client and the server configuration,
and lacks any additional logic/filters.
We need the KeyManager to deterministically pick the node
certificate/key in all cases as this is the intended entry to be
used for TLS on the HTTP layer.
This change introduces filtering when creating the in-memory
keystore the KeyManager is loaded with, so that it will not
include PrivateKeyEntry objects when:
- there are more than 1 PrivateKeyEntry objects in the keystore
- The leaf certificate associated with the PrivateKeyEntry is a
CA certificate
Related: #75097

Co-authored-by: Ioannis Kakavas <ioannis@elastic.co>
2021-07-09 00:53:20 +02:00
Henning Andersen 12b4fcf0fe
ReindexIT wait for task to really start (#73018)
Reindex and friends have tasks that start but are not ready to
rethrottle before they figured out if they are leader or worker
tasks. Now wait for the task to fully start before rethrottling.

Also added additional assertions to help see if the inability
to rethrottle is caused by some failure.

Closes #60811
2021-07-01 13:06:06 +02:00
Almog Tavor 34cfa40fae
Fix comparison of identical values leads to a bug of non-effective value (#74040) 2021-06-28 10:14:34 -07:00
Sylvain Wallez 32c196f655
Fix HLRC compatibility with Java 8 (#74290)
Optional.isEmpty() was added in Java 11. In Java 8 we only have
Optional.isPresent()
2021-06-28 17:08:53 +02:00
Armin Braun cbf48e0633
Flatten Get Snapshots Response (#74451)
This PR returns the get snapshots API to the 7.x format (and transport client behavior) and enhances it for requests that ask for multiple repositories.
The changes for requests that target multiple repositories are:
* Add `repository` field to `SnapshotInfo` and REST response
* Add `failures` map alongside `snapshots` list instead of returning just an exception response as done for single repo requests
* Pagination now works across repositories instead of being per repository for multi-repository requests

closes #69108
closes #43462
2021-06-24 16:58:33 +02:00
Ioannis Kakavas 74932503a6
Enroll Node API doesn't return a cluster name (#74514)
During implementation we discovered that the clusters should not
necessarily have a unique name and thus we don't need to convey
this information in the response of the Enroll Node API.
2021-06-24 11:27:04 +03:00
Ioannis Kakavas 82e7fbda53
Add the Enroll Kibana API (#72207)
This change adds the Enroll Kibana API that enables a Kibana instance to
configure itself to communicate with a secured elasticsearch cluster
2021-06-23 22:58:46 +03:00
Yang Wang 231134572e [Test] Correct matcher for matching single element 2021-06-23 18:02:16 +10:00
Yang Wang 0c11c6411e [Test] Avoid reusing the same token name for tests
Relates: #74280
2021-06-23 10:23:50 +10:00
Yang Wang 60ee57f079 [Test] Even More robust assertions for possible overlapping tests
Relates: #74280
2021-06-23 00:47:10 +10:00
Rene Groeschke 59fb90487b
Simplify test only project precommit checks (#74172)
we do not need thirdparty check for test only projects
2021-06-22 16:34:07 +02:00
Yang Wang ad8d96e2fb [Test] More robust assertions for possible overlapping tests
Relates: #74280
2021-06-23 00:10:04 +10:00
Yang Wang 19e58c24a5
[Test] Avoid use the same token name in different tests (#74280)
The name token1 is used in both testGetServiceAccountCredentials and
testCreateServiceAccountToken. There are times when the two tests are not fully
isolated. This leads to test failure because indexing of the service token
document must be an op_create. This PR fixes the failure by using a different
token name in testGetServiceAccountCredentials.
2021-06-22 21:01:43 +10:00
Martijn van Groningen 4d84f11ef3
Add meta field to deprecation issue definition. (#74085)
This will allow components to add custom metadata to deprecation issues.
This make extracting additional details about deprecations more robust,
otherwise these details need to be parsed from the deprecation message field.

Adjusted the ml model snapshot deprecation to use custom metadata, and
included the job id and snapshot id as custom metadata.

Closes #73089
2021-06-22 12:05:16 +02:00
Armin Braun 269718ff10
Enhance Tests around SnapshotInfo UserMetadata (#74362)
We barely test the correct handling of user metadata directly.
With upcoming changes to how `SnapshotInfo` is stored it would be nice
to have better test coverage. This PR adds randomized coverage of serializing
user metadata to a large number of tests that all user the shared infrastructure
that is adjusted here.
2021-06-21 19:41:01 +02:00
David Turner 3bbdd3428d AwaitsFix for #74278 2021-06-18 08:31:49 +01:00
Sylvain Wallez c06608d4e6
Verify that main info response returns correct product headers (#73910)
Follow-up to #73434

Ensures that High Level Rest Client is running against a verified
Elasticsearch. When the first request is send on HLRC, a request to the
info endpoint is made first to verify the product identification and
version.
2021-06-17 23:29:07 +02:00
David Roberts c9a613666f
[ML] Remove the undocumented "delimited" format for post_data (#74188)
The data_description of anomaly detection jobs used to accept
delimited data, although this was never documented.

This change removes the delimited option from the data_description,
and the associated functionality in post_data that handled it.

This is not a breaking change because it's removing functionality
that officially never existed.  However, just in case somebody
was using it it is only removed from 8.0 and higher, so that at
least they won't find out during a patch install.
2021-06-17 15:30:27 +01:00
Yang Wang 2350369782
Service Accounts - HLRC (#72431)
This PR adds corresponding components in High Level Rest Client for the new
APIs related to the service accounts feature.
2021-06-17 21:27:20 +10:00
Martijn van Groningen 80593b43f6
Tidy up deprecation code. (#74065)
Removed unused code and made fields immutable.
2021-06-14 19:15:10 +02:00
Nhat Nguyen 1211b9d5e4
Fix HLRC doc link for point in time API (#73874)
The PIT's docs in HLRC wasn't linked properly.
2021-06-09 12:32:30 -04:00
Ryan Ernst ab1a2e4a84
Add precommit task for detecting split packages (#73784)
Modularization of the JDK has been ongoing for several years. Recently
in Java 16 the JDK began enforcing module boundaries by default. While
Elasticsearch does not yet use the module system directly, there are
some side effects even for those projects not modularized (eg #73517).
Before we can even begin to think about how to modularize, we must
Prepare The Way by enforcing packages only exist in a single jar file,
since the module system does not allow packages to coexist in multiple
modules.

This commit adds a precommit check to the build which detects split
packages. The expectation is that we will add the existing split
packages to the ignore list so that any new classes will not exacerbate
the problem, and the work to cleanup these split packages can be
parallelized.

relates #73525
2021-06-08 15:04:23 -07:00
Ryan Ernst 63012c8a40
Move ParseField to o.e.c.xcontent (#73923)
ParseField is part of the x-content lib, yet it doesn't exist under the
same root package as the rest of the lib. This commit moves the class to
the appropriate package.

relates #73784
2021-06-08 13:32:14 -07:00
Ryan Ernst 68817d7ca2
Rename o.e.common in libs/core to o.e.core (#73909)
When libs/core was created, several classes were moved from server's
o.e.common package, but they were not moved to a new package. Split
packages need to go away long term, so that Elasticsearch can even think
about modularization. This commit moves all the classes under o.e.common
in core to o.e.core.

relates #73784
2021-06-08 09:53:28 -07:00
Przemyslaw Gomulka 4bdd00d452
[Rest Api Compatibility] Typed endpoint for bulk api (#73571)
retrofits typed endpoint and type in request parsing
the original types removal commit
#46983

relates #51816
2021-06-07 19:36:31 +02:00
Ryan Ernst f98b374cf6
Revert "Upgrade Azure SDK and Jackson (#72833) (#72995)" (#73837)
The recent upgrade of the Azure SDK has caused a few test failures that
have been difficult to debug and do not yet have a fix. In particular, a
change to the netty reactor resolving
(https://github.com/reactor/reactor-netty/issues/1655). We need to wait
for a fix for that issue, so this reverts commit
6c4c4a0ecb.

relates #73493
2021-06-07 10:20:46 -07:00
Francisco Fernández Castaño a8101f346f
Add support for index pattern exclusion in CCR AutoFollow (#72935)
This commit adds the ability to specify exclusion patterns in Auto-Follow patterns. This allows excluding indices that match any of the inclusion patterns and also match some of the exclusion patterns giving more fine grained control in scenarios where this is important.

Related #67686
2021-06-04 13:53:30 +02:00
Przemyslaw Gomulka aba2282511
Change year max digits for strict_date_optional_time and date_optional_time (#73034)
We changed the default joda behaviour in strict_date_optional_time to
max 4 digits in a year. Java.time implementation should behave the same way.
At the same time date_optional_time should have 9digits for year part.

closes #52396
closes #72191
2021-06-04 09:35:07 +02:00
David Kyle 94adaa55c0
[ML] Merge the pytorch-inference feature branch (#73660)
The feature branch contains changes to configure PyTorch models with a 
TrainedModelConfig and defines a format to store the binary models. 
The _start and _stop deployment actions control the model lifecycle 
and the model can be directly evaluated with the _infer endpoint. 
2 Types of NLP tasks are supported: Named Entity Recognition and Fill Mask.

The feature branch consists of these PRs: #73523, #72218, #71679
#71323, #71035, #71177, #70713
2021-06-03 12:43:06 +01:00
David Roberts 0059c59e25
[ML] Make ml_standard tokenizer the default for new categorization jobs (#72805)
Categorization jobs created once the entire cluster is upgraded to
version 7.14 or higher will default to using the new ml_standard
tokenizer rather than the previous default of the ml_classic
tokenizer, and will incorporate the new first_non_blank_line char
filter so that categorization is based purely on the first non-blank
line of each message.

The difference between the ml_classic and ml_standard tokenizers
is that ml_classic splits on slashes and colons, so creates multiple
tokens from URLs and filesystem paths, whereas ml_standard attempts
to keep URLs, email addresses and filesystem paths as single tokens.

It is still possible to config the ml_classic tokenizer if you
prefer: just provide a categorization_analyzer within your
analysis_config and whichever tokenizer you choose (which could be
ml_classic or any other Elasticsearch tokenizer) will be used.

To opt out of using first_non_blank_line as a default char filter,
you must explicitly specify a categorization_analyzer that does not
include it.

If no categorization_analyzer is specified but categorization_filters
are specified then the categorization filters are converted to char
filters applied that are applied after first_non_blank_line.

Closes elastic/ml-cpp#1724
2021-06-01 15:11:32 +01:00
Tanguy Leroux d499061c30
Mute RestClientMultipleHostsIntegTests.testCancelAsyncRequests (#73592)
Relates #45577
2021-06-01 14:57:51 +02:00
Rene Groeschke b2a183baf0
Move public build api into included build (#72861)
This moves the public build api and plugins into a separete included build called 'build-tools' 
and we removed the duplication of included buildSrc twice (2nd import as build-tools).

The elasticsearch internal build logic is kept in build-tools-internal as included build which allows us better handling of this project that its just being an buildSrc project (e.g. we can reference tasks directly from the root build etc.)

Convention logic applied to both projects will live in a new build-conventions project.
2021-06-01 11:19:30 +02:00
Martijn van Groningen 28d69de040
Make assertion less flaky in IndicesClientIT.testDataStreams(). (#73556)
Instead of assertion that store stats has a non zero value,
just verify that a value is returned. Verifying whether a
non value or specific value is returned, isn't the purpose
of hlrc integration tests.

Closes #60461
2021-05-31 15:30:13 +02:00
Dan Hermann 40a029f5ba
Deprecate freeze index API (#72618) 2021-05-27 15:14:50 -05:00
Ryan Ernst 6c4c4a0ecb
Upgrade Azure SDK and Jackson (#72833) (#72995)
This commit upgrades the Azure SDK to 12.11.0 and Jackson to 2.12.2. The
Jackson upgrade must happen at the same time due to Azure depending on
this new version of Jackson.

closes #66555
closes #67214

Co-authored-by: Francisco Fernández Castaño <francisco.fernandez.castano@gmail.com>
2021-05-27 07:55:18 -07:00
Ignacio Vera 409b6cefe3
Add painless script support for geo_shape field (#72886)
Users can access the centroid, bounding box and dimensional type of the shape.
2021-05-26 18:55:45 +02:00
David Roberts ffa38331c9 Muting ILMDocumentationIT.testAddSnapshotLifecyclePolicy
Due to https://github.com/elastic/elasticsearch/issues/73317
2021-05-24 14:54:17 +01:00
Greg Back 6f46ae43e3
Fix comment about number of roles (#73163)
This comment is out of date since #71710.
2021-05-17 11:05:03 -04:00
David Turner b2956b3ae7
Identify cancelled tasks in list tasks API (#72931)
This commit adds a `cancelled` flag to each cancellable task in the
response to the list tasks API, allowing users to see that a task has
been properly cancelled and will complete as soon as possible.

Closes #72907
2021-05-17 11:02:50 +01:00
Nhat Nguyen 44fc661835
Add point in time to HLRC (#72167)
Closes #70593
2021-05-12 17:59:25 -04:00
Przemyslaw Gomulka 85ed9100df
[Rest Api Compatibility] Typed endpoints for search and related endpoints (#72155)
Implements a V7 compatible typed endpoints for REST for search related apis
retrofits the REST layer change removed in #41640

relates main meta issue #51816
relates types removal issue #54160
2021-05-12 21:00:19 +02:00
Ioannis Kakavas b826703e21
Enroll node API (#72129)
Enroll node API can be used by new nodes in order to join an
existing cluster that has security features enabled. The response
of a call to this API contains all the necessary information that
the new node requires in order to configure itself and bootstrap
trust with the existing cluster.
2021-05-12 08:45:02 +03:00
Yang Cheng d33d41d916
[HLRC] change GET method to POST in Searchtemplate (#72851)
Fix #72073
Close #72397
2021-05-11 08:12:01 -06:00
Ryan Ernst 8cd3944a0a
Revert "Upgrade Azure SDK and Jackson (#72833)"
This reverts commit dca0e92bef.
2021-05-06 20:51:31 -07:00
Ryan Ernst dca0e92bef
Upgrade Azure SDK and Jackson (#72833)
This commit upgrades the Azure SDK to 12.11.0 and Jackson to 2.12.2. The
Jackson upgrade must happen at the same time due to Azure depending on
this new version of Jackson.

closes #66555
closes #67214
2021-05-06 20:36:42 -07:00
Rene Groeschke e609e07cfe
Remove internal build logic from public build tool plugins (#72470)
Extract usage of internal API from TestClustersPlugin and PluginBuildPlugin and related plugins and build logic

This includes a refactoring of ElasticsearchDistribution to handle types
better in a way we can differentiate between supported Elasticsearch
Distribution types supported in TestCkustersPlugin and types only supported
in internal plugins.

It also introduces a set of internal versions of public plugins.

As part of this we also generate the plugin descriptors now.

As a follow up on this we can actually move these public used classes into 
an extra project (declared as included build)

We keep LoggedExec and VersionProperties effectively public And workaround for RestTestBase
2021-05-06 14:02:35 +02:00
Tanguy Leroux 2fee5e0990
Mute ReindexIT.testDeleteByQuery (#72546)
Relates #60811
2021-04-30 14:09:28 +02:00
William Brafford 8f0e5dcadd
Feature reset integration test should tolerate failed resets (#72326)
* Remove redundant section of test
* Mention in javadoc that we check task index specifically
2021-04-27 15:51:57 -04:00