Commit graph

1510 commits

Author SHA1 Message Date
Rene Groeschke
468bef1b9e
[7.17] Update gradle wrapper to 8.4 (#99856) (#100926)
* Remove deprecated forConfigurationTime usage
2023-10-17 13:44:48 +02:00
Rene Groeschke
5afd06ae57
[7.17] Update Gradle Wrapper to 8.2 (#96686) (#97484)
* Update Gradle Wrapper to 8.2 (#96686)

- Convention usage has been deprecated and was fixed in our build files
- Fix test dependencies and deprecation
2023-09-27 08:46:44 +02:00
Mark Vieira
0c1c6ffec8
Mute SecurityDocumentationIT.testDelegatePkiAuthentication 2023-07-18 10:34:48 -07:00
Mark Vieira
47c6fd34da
[7.17] Add JUnit rule based integration test cluster orchestration framework… (#92517)
This commit adds a new test framework for configuring and orchestrating
test clusters for both Java and YAML REST testing. This will eventually
replace the existing "test-clusters" Gradle plugin and the build-time
cluster orchestration.
2022-12-22 17:48:07 -08:00
David Roberts
93b3584e4f
Account for using ML snapshot builds in HLRC release tests (#90066)
Since https://github.com/elastic/elasticsearch/pull/89951 we use
ML snapshot builds in all elasticsearch-ci jobs, even the
release-tests ones.

The test of the reported ML native code version in the HLRC tests
needs to account for this.

This change is 7.17 only, as the HLRC is removed in 8.x.
2022-09-17 08:22:05 +01:00
Christos Soulios
e85056b2f0
Unmute test (#89979)
Test had been muted because of issue #67749

This PR unmutes test RollupIT.testPutStartAndGetRollupJob() because most probably it has
been fixed by #86992

Closes #67749
2022-09-12 16:08:49 +03:00
Tanguy Leroux
17f4e0b141
[7.17] Fix mount snapshot api ignoring unknown request parameter (#89061)
The High Level REST Client provides a MountSnapshotRequest#ignoredIndexSettings(String[]) method to define some index settings to ignore when mounting a snapshot as a searchable snapshot index.

Sadly the client generates a wrong request body field ignored_index_settings instead of ignore_index_settings. This wasn't caught until #75982 was reported because the parser of Mount API request ignores unknown fields in request body.

We fixed the wrong leniency of the request parser on the Elasticsearch side (#88987) starting version 8.5.0, and we decided to continue to ignore the ignored_index_settings generated by the HLRC bug to avoid breaking HLRC client usages.

This change fixes the request body generated by the HLRC to pass the correct field name. This fix is for versions 7.17.6+ (we do not expect to release new versions of HLRC in 8.x).

It also renames the HLRC methods to expose the change to client users.

Co-authored-by: bellengao <bellengao@tencent.com>
2022-08-04 19:12:06 +02:00
Rene Groeschke
62294616df
[7.17] Rework testing conventions gradle plugin (#87213) (#88422)
Backports the following commits to 7.17:
 - Rework testing conventions gradle plugin (#87213)
2022-07-12 10:58:40 +02:00
Rene Groeschke
448ab34957
[7.17] Use internal-java-rest-test in high level rest client (#86837)
This is 7.17 specific change before we can backport the deletion of the elasticsearch.rest-test plugin
2022-05-23 10:05:14 +02:00
Seth Michael Larson
79878662c5
Revert "Enable HLRC compatibility mode by default (#86517)" (#86873)
This reverts commit 0cb5108942.
2022-05-17 18:06:52 -05:00
Sylvain Wallez
0cb5108942
Enable HLRC compatibility mode by default (#86517) 2022-05-12 19:00:54 +02:00
Tanguy Leroux
750bb1e46a
Mute MigrationIT.testGetDeprecationInfo (#85813) (#85814)
Relates #85743
2022-04-12 07:02:44 -04:00
Will James
4c41c7a9f4
Do not send default ignore_throttled parameter since it is deprecated (#84827) 2022-03-10 18:14:15 +01:00
Rene Groeschke
4de3fb5eaf
Remove usage of deprecated Provider#forUseAtConfigurationTime (#83932) (#83947)
Remove gradle api usage that has been deprecated with Gradle 7.4
2022-02-15 16:45:24 +01:00
Tanguy Leroux
d03aaf1262
Mute RollupIT.testPutStartAndGetRollupJob (#83503) (#83505)
Relates #67749
2022-02-04 06:15:47 -05:00
Tim Vernum
bbd504275a
Expand example in HLRC put-role docs (#82139)
This expands the example in the High Level Rest Client's Put Role
documentation to include an example of creating a role with index
privileges, include FLS and DLS Relates: #81354
2021-12-30 04:39:59 -05:00
Rory Hunter
358cd80d34 Formatting escape hatch (#81806)
Thanks to https://bugs.eclipse.org/bugs/show_bug.cgi?id=574437,
we've run into a situation where Spotless is incorrectly formatting
a particular piece of syntax (due the underlying Eclipse bug). We
were able to turn off formatting of this syntax using `// @formatter:off`
and `// @formatter:on`, but there was a further problem. We configure
IntelliJ to use the Eclipse formatter plugin, but this doesn't
respect the `@formatter` tags since these are set at the Spotless
level, not the Eclipse formatter level. Note that these tags aren't
set in the Eclipse formatter config, because there we use `// tag::`
and `// end::` in order to avoid reformatting docs snippets, which
have a much narrower line width.

What a mess.

So, to get around all this, drop the `@formatter` tags and tweak
our custom `SnippetLengthCheck` Checkstyle rule so that
`// tag:noformat` regions are not subject to the narrower line length
check, but are still exempt from formatting.
2021-12-16 16:28:17 +00:00
Lee Hinman
cb5766c197
[7.16] Change HLRC's LifecyclePolicy to allow all valid ILM actions (#81483) (#81765)
* Change HLRC's LifecyclePolicy to allow all valid ILM actions (#81483)

This commit changes the High Level Rest Client's `LifecyclePolicy`
implementation to allow all the same valid actions for each phase that
ILM supports. It was previously missing actions in the hot and cold
phases, as well as missing the frozen phase entirely. This also adds a
test that uses the "real" `TimeseriesLifecycleType.ORDERED_*ACTIONS`
lists so that if an action is added or removed in the future the test
will fail. Resolves #81461
# Conflicts:
#	client/rest-high-level/src/test/java/org/elasticsearch/client/indexlifecycle/LifecyclePolicyTests.java
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java

* Fix test
2021-12-15 11:13:33 -05:00
Andrei Stefan
eeb39f8499
EQL: HLRC documentation (#80979) 2021-12-08 13:56:25 +02:00
Hendrik Muhs
969e5655ef
[7.16] [Transform] handle pit index not found error (#81368) (#81491)
Do not fail the transform if pit search fails with index not found as a result of an index that got deleted via ILM, 
if that index is part of a search that selects indices using a wildcard, e.g. logs-*. If pit search fails, the search 
is retried using search without a pit context. The 2nd search might fail if the source targets an explicit index. 
In addition the usage of the pit API can not be disabled by transform.

fixes elastic#81252
relates elastic#81256
2021-12-08 09:44:56 +01:00
Martijn van Groningen
deb0d4c8c7
[7.16] Add replicated field to get data stream api response. (#81140)
* [7.16] Add replicated field to get data stream api response.

Backporting #80988 to 7.16 branch.

Internally we already kept track of whether a data stream is replicated by CCR.
It is part of the `DataStream` class. This just adds it to the xcontent serialization
of the get data stream api response class.

Relates to elastic/kibana#118899

* adjust to 7.16 reality
2021-11-30 06:01:49 -05:00
Artem Prigoda
47da0dca20
[7.16] Revert "Deprecate returning 408 for a server timeout on _cluster/health (#78180)" (#80831)
* Revert "Allow deprecation warning for the return_200_for_cluster_health_timeout parameter (#80178) (#80445)"

This reverts commit 5a5300753d.

* Revert "[7.x] Use query param instead of a system property for opting in for new cluster health response code (#79397) (#79435)"

This reverts commit d8c14281

* Revert "[7.x] Deprecate returning 408 for a server timeout on `_cluster/health` (#78180) (#78940)"

This reverts commit 03bd55d1
2021-11-18 16:57:39 +01:00
Benjamin Trent
4724553d91
[ML] deprecate estimated_heap_memory_usage_bytes and replace with model_size_bytes (#80545)
This deprecates estimated_heap_memory_usage_bytes on model put and replaces it with model_size_bytes.

On GET, both fields are returned (unless storing in the index) and are populated with the same field.

For the ml/info API, both fields are returned as well.
2021-11-10 11:24:04 -05:00
Rory Hunter
c2da6b1223 Fix HiddenField checkstyle problems in client/ (#80549)
Part of #19752.

Fix a number of cases of shadows vars under `client/rest-high-level`. As
part of this, fork the Checkstyle `HiddeFieldCheck` class so that it
understand the pattern of settings with no "set" prefix.
2021-11-10 13:50:43 +00:00
Ryan Ernst
9336cfd931
Convert uses of mockito Matchers to ArgumentMatchers (#79852) (#79964)
Matchers is deprecated in Mockito, in favor of the newer
ArgumentMatchers class. In fact, internally Matchers just extends
ArgumentMatchers as all the methods there were moved. This commit
changes all imports of org.mockito.Matchers to
org.mockito.ArgumentMatchers.
2021-10-27 18:13:26 -07:00
Mark Vieira
de15f4b62d Fix malformed signature used for integration test license 2021-10-27 16:07:13 -07:00
Mark Vieira
bcfbf00074 Reformat Elasticsearch source 2021-10-27 15:23:15 -07:00
Henning Andersen
3cad9c1c39 Rethrottle tests wait for task to start (#77822)
Improved how we wait for tasks to really start, to ensure that
rethrottle does not fail the test.

Closes #75327
2021-10-27 23:19:01 +02:00
Lee Hinman
08214dcf84
Add deprecation headers to HLRC classes (#79754) (#79763)
This commit adds the @Deprecated annotation and Javadoc to HLRC classes.
# Conflicts:
#	client/rest-high-level/qa/ssl-enabled/src/javaRestTest/java/org/elasticsearch/client/documentation/EnrollmentDocumentationIT.java
#	client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/EnrichDocumentationIT.java
#	qa/ccs-rolling-upgrade-remote-cluster/src/test/java/org/elasticsearch/upgrades/SearchStatesIT.java
#	x-pack/qa/reindex-tests-with-security/src/test/java/org/elasticsearch/xpack/security/ReindexWithSecurityIT.java
#	x-pack/qa/security-example-spi-extension/src/javaRestTest/java/org/elasticsearch/example/role/CustomRolesProviderIT.java
#	x-pack/qa/smoke-test-plugins-ssl/src/test/java/org/elasticsearch/smoketest/SmokeTestMonitoringWithSecurityIT.java
2021-10-25 19:12:52 -04:00
Hendrik Muhs
6405fea8e4
[7.16][Transform] Improve transform upgrader (#79601) (#79700)
* [Transform] Improve transform upgrader (#79601)

This changes fixes some issues with the upgrader. It inlines the index name resolver as wildcard
deletes are not supported if action.destructive_requires_name is set to true(default). It changes
response to always return all counters in order to avoid an empty response. After documentation has
been created, it switches the deprecation URL to the upgrade API docs.

* change url to 7.16 specific one

* fix 7.x specific test

* fix put mapping call
2021-10-25 07:49:08 -04:00
Ryan Ernst
09c88797d2
Upgrade mockito to 3.12.4 (#79669) (#79686)
Securemock is a wrapper around Mockito that monkey patches internals of
Mockito to work with the SecurityManager. However, the library has not
been updated in several years due to the complicated nature of this
monkey patching. This has left us with an ancient version of Mockito,
missing out on updates to the library in the last half decade.

While Securemock currently works with Mockito 1.x, in 2.x an official
means of plugging into mockito was added, MockMaker. This commit removes
securemock as a dependnecy of the test framework, replacing it with a
modern version of Mockito, and implementing a MockMaker that integrates
with SecurityManager.

Note that while there is a newer version of Mockito available, 4.0, it
has several deprecations removed that are used throughout Elasticsearch.
Those can be addressed in followups, and then a subsequent upgrade to
4.0 should be possible.

relates #79567
closes #40334
2021-10-24 10:46:03 -07:00
Keith Massey
f662dc1cf3
Updating deprecation message wording based on docs team feedback (#79387)
This commit updates deprecation info API wording based on feedback from the docs team.
2021-10-20 09:46:06 -05:00
Gordon Brown
35dc030ed8
Implement framework for migrating system indices (#78951)
This PR adds a framework for migrating system indices as necessary prior
to Elasticsearch upgrades. This framework uses REST APIs added in
another commit:
- GET _migration/system_features

This API, which gets the status of "features" (plugins which own system
indices) with regards to whether they need to be upgraded or not. As of
this PR, this API also reports errors encountered while migrating system
indices alongside the index that was being processed when this occurred.

As an example of this error reporting:

```json
{
    "feature_name": "logstash_management",
    "minimum_index_version": "8.0.0",
    "upgrade_status": "ERROR",
    "indices": [
        {
            "index": ".logstash",
            "version": "8.0.0",
            "failure_cause": {
                "error": {
                    "root_cause": [
                        {
                            "type": "runtime_exception",
                            "reason": "whoopsie",
                            "stack_trace": "<omitted for brevity>"
                        }
                    ],
                    "type": "runtime_exception",
                    "reason": "whoopsie",
                    "stack_trace": "<omitted for brevity>"
                }
            }
        }
    ]
}
```

- POST _migration/system_features

This API starts the migration process. The API for this has no changes,
but when called, any system indices which need to be migrated will be
migrated, with status information stored in the cluster state for later
use by the GET _migration/system_features API.
2021-10-19 20:16:39 -06:00
Przemko Robakowski
8fe8e6f039
Store Template's mappings as bytes for disk serialization (#78746) (#79522)
This change the way we store mappings in `Template` during serialization
to disk - instead storing it as map we use byte array that we already
have. This avoids deserialization-serialization cycle during storing
cluster state on disk.
# Conflicts:
#	server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java
2021-10-19 19:14:54 -04:00
William Brafford
159cb4413c
Use 'migration' instead of 'upgrade' in GET system feature migration status responses (#79302) (#79495)
* Change 'upgrade' to 'migration' in System Index Migration responses
2021-10-19 13:32:53 -04:00
Artem Prigoda
d8c1428136
[7.x] Use query param instead of a system property for opting in for new cluster health response code (#79397) (#79435)
Backport #79351 to 7.x:

The original change was implemented in #78940, but we have decided to move from a system property
to a request parameter, so Cloud users/clients have an easier way to opt-in for the new status code.

Relates #70849
2021-10-19 14:21:34 +01:00
Artem Prigoda
bcaf956e49
Revert "[7.x] Use query param instead of a system property for opting in for new cluster health response code (#79397)" (#79432)
This reverts commit fbe49d15b0.
2021-10-19 10:15:58 +02:00
Artem Prigoda
fbe49d15b0
[7.x] Use query param instead of a system property for opting in for new cluster health response code (#79397)
Backport #79351 to 7.x:

The original change was implemented in #78940, but we have decided to move from a system property
to a request parameter, so Cloud users/clients have an easier way to opt-in for the new status code.

Relates #70849
2021-10-18 23:52:12 +02:00
Nikola Grcevski
8512037aaa
[7.x] Deprecation of transient cluster settings (#78794) (#79288)
This PR changes uses of transient cluster settings to
persistent cluster settings.

The PR also deprecates the transient settings usage.

Relates to #49540
2021-10-15 19:06:33 -04:00
Jim Ferenczi
34b3a9a144
Force typed keys in the HLRC get async search (#78992) (#79245)
This change ensures that the HLRC can parse the search response
that the get async search returns.
The aggregations must be typed by keys but the param to enable this
mode was missing.

Closes #77608
2021-10-15 16:06:54 +02:00
Przemysław Witek
aee722dd39
[7.x] [Transform] Add _meta field to TransformConfig (#79003) (#79219) 2021-10-15 12:14:10 +02:00
Hendrik Muhs
7673778034
[7.x][Transform] add transform upgrade endpoint (#77566) (#79097)
* [Transform] add transform upgrade endpoint (#77566)

Add an _upgrade endpoint to bulk upgrade transforms. _upgrade rewrites all transforms and its
artifacts into the latest format to the latest storage(index). If all transforms are upgraded old
indices and outdated documents get deleted. Using the dry_run option it is possible to check if
upgrades are necessary without applying changes.

* fix merge conflicts

* 7.x requires a different license check
2021-10-14 04:39:39 -04:00
Jim Ferenczi
5416582f57
Filter original indices in shard level request (#78508)
Today the search action send the full list of original indices on every shard request.
This change restricts the list to the concrete index of the shard or the alias that was used to resolve it.

Relates #78314
2021-10-14 10:34:08 +02:00
Nikola Grcevski
a7ae031ce7
[7.x] [TEST] Switch to persistent settings in java tests (#78562) (#79103)
Migrate to persistent cluster settings in Java tests

We are deprecating transient settings, therefore this
PR changes uses of transient cluster settings to
persistent cluster settings.
2021-10-13 20:10:11 -04:00
Chris Hegarty
964180ba99
[7.x] Fix split package org.elasticsearch.common.xcontent (#79061)
* Fix split package org.elasticsearch.common.xcontent

* Fix test
2021-10-13 15:43:41 +01:00
William Brafford
1b5827da3e
Implement GET API for System Feature Upgrades (#78642) (#78860)
* Implement GET API for System Feature Upgrades (#78642)

* Implement and test get feature upgrade status API
* Add integration test for feature upgrade endpoint
* Use constant enum for statuses
* Add unit tests for transport class methods
* Fix bwc tests for 7.x
2021-10-12 15:44:45 -04:00
Artem Prigoda
03bd55d197
[7.x] Deprecate returning 408 for a server timeout on _cluster/health (#78180) (#78940)
Backports #78180 to 7.x.

Add a deprecation warning and a system property es.cluster_health.request_timeout_200 to opt in for returning 200 which will be the default in 8.0.0

Fixes #70849
2021-10-11 22:13:26 +02:00
Hendrik Muhs
68eaec2ba4
[Transform] HLRC cleanups (#78909) (#78912)
removes some "data frame" leftovers in transform code, no functional changes
2021-10-11 07:48:20 -04:00
Armin Braun
7630301bd3
Introduce a Few Settings Singleton Instances (#78897) (#78908)
This is mostly motivated by the ILM steps changes, that showed up as hot in
profiling since instantiating a `Settings` instance turns out to be somewhat expensive.
Also cleans up a couple of other spots and some duplication as well.
2021-10-11 12:20:40 +02:00
Ignacio Vera
82dc997010
Move legacy geo_shape implementation to its own module (#77856) (#78735)
This commit moves the legacy geo_shape implementation to its own module and removes
the dependency on Spatial4J / JTS from server.
2021-10-11 08:23:22 +02:00