Commit graph

140 commits

Author SHA1 Message Date
Matteo Piergiovanni
54cfce4379
Flag in _field_caps to return only fields with values in index (#103651)
We are adding a query parameter to the field_caps api in order to filter out 
fields with no values. The parameter is called `include_empty_fields`  and 
defaults to true, and if set to false it will filter out from the field_caps 
response all the fields that has no value in the index.
We keep track of FieldInfos during refresh in order to know which field has 
value in an index. We added also a system property 
`es.field_caps_empty_fields_filter` in order to disable this feature if needed.

---------

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
2024-02-08 17:52:21 +01:00
Joe Gallo
f2e7b64c18
Remove gradle references to the rest-high-level client (#104871) 2024-01-29 14:13:06 -05:00
Armin Braun
51caf171bc
Remove redudant children of BroadcastResponse (#104410)
A couple of children of `BroadCastResponse` are completely redundant,
adding no extra fields or separate serialization.
Removed them and replaced their use by the broadcast response itself.
2024-01-16 16:56:29 +01:00
Lorenzo Dematté
cea88cbeec
Replace Version with String in YAML framework, pushing Version parsing where is actually needed (#103311)
* Pushing down node versions as strings

Deferring Version parsing to the actual places where a minimum node version/common cluster version is needed; eventually this will be completely lazy and/or replaced by other checks (e.g. features).
Combine versions, oses and features in multi-cluster YAML test contexts.
2024-01-03 09:29:40 +01:00
Lorenzo Dematté
1900a99018
Refactor: move version, os, features from ClientYamlTestClient to ClientYamlTestExecutionContext (#103560)
Just moving stuff around, no change in behaviour. Moving these fields showed how we are not treating correctly in derived classes where multiple clusters are tested (ex: CCR), but this is for another time.

Co-authored-by: Moritz Mack <moritz@mackmail.net>
2023-12-20 10:05:19 +01:00
Ignacio Vera
f6da877605
Fix mistake when removing the High level rest Client in CCSDuelIT (#102330) 2023-11-17 11:17:03 +01:00
Ignacio Vera
c579ab2d4a
Remove HighLevelRestClient from CCSDuelIT (#102222) 2023-11-16 12:18:03 +01:00
Panagiotis Bailis
25b80acb38
Removing explicit SearchResponse usages in tests - v2 (#102021) 2023-11-13 16:56:14 +02:00
Armin Braun
3945ee75d0
Use assertAcked more (#101201)
Just found that we have a lot of inconsistency and needless verbosity
here in tests. We can just use `assertAcked` in a couple spots
to save `.get`, `.actionGet` etc., especially with the signature
change I added here.
2023-10-23 19:48:10 +02:00
Matteo Piergiovanni
d9c15c526e
Add counters to _clusters response for all states (#99566)
To help the user know what the possible cluster states are and to 
provide an accurate accounting, we added counters summarising
`running`, `partial` and `failed` clusters to the `_clusters` section.
Changes:
- Now in the response is present the number of `running` clusters.
- We split up `partial` and `successful` (before was summed up in the 
`successful` counter).
- We now have a counter for `failed` clusters.
- Now `total` is always equal to `running` + `skipped` + `failed` + 
`partial` + `successful`.
2023-09-28 09:28:45 +02:00
Michael Peterson
649821e992
Support cluster/details for CCS minimize_roundtrips=false (#98457)
This commit tracks progress for each shard search by cluster alias
using a new SearchProgressListener (CCSSingleCoordinatorSearchProgressListener).
Both sync and async CCS searches use this new progress listener when
minimize_roundtrips=false.

Two of the SearchProgressListener method had to be extended to allow tracking
per-cluster took values (TransportSearchAction.SearchTimeProvider) and
whether searches timed out (by passing in QuerySearchResult to the onQueryResult
listener method).

This commit brings parity between minimize_roundtrips=true and false to have
the same _cluster/details sections in CCS search responses.

Note that there are still a few differences between minimize_roundtrips=true and false.
1. The per-cluster took value for minimize_roundtrips=true is accurate, but the
   for 'false' it is only measured at the granualarity of each partial reduce,
   so the per cluster took time is overestimated in basically all cases.
2. For minimize_roundtrips=true, a skip_unavailable=false cluster that disconnects
   during the search or has all searches on all shards fail, will cause the entire
   search to fail. This is (still) not true for minimize_roundtrips=false. The search
   is only failed if the skip_unavailable=false cluster cannot be connected to at the
   start of the search. (This will likely be changed in a follow up ticket that implements
   fail-fast logic for in-progress searches that should fail due to a skip_unavailable=true
   cluster failing.)
3. The shard accounting for minimize_roundtrips=false is always accurate (total shard counts
   are known at the start of the search). For minimize_roundtrips=true, the shard accounting
   is only accurate per cluster unless all clusters have successful (or partially successful)
   searches. For clusters that have failures we do not have shard count info.
2023-08-31 12:56:20 -04:00
Michael Peterson
6420924e31
Minor improvements for Cross-Cluster Search code (#98405)
Several minor structural and test improvements for cross-cluster search

These changes set the stage for a follow-on ticket to add _cluster/details to
cross-cluster searches with minimize_roundtrips = false. To help keep that
PR from being too large some of the simpler required changes and tests
are added in this PR.
2023-08-13 19:30:17 -04:00
Michael Peterson
8b1cd47455
Support CCS minimize round trips in async search (#96012)
* Support CCS minimize round trips in async search

This commit makes the smallest set of changes to allow async-search based cross-cluster search
to work with the CCS minimize_round_trips feature without changing the internals/architecture of
the search action.

When ccsMinimizeRoundtrips is set to true on SubmitAsyncSearchRequest, the AsyncSearchTask on the
primary CCS coordinator sends a synchronous SearchRequest to all to clusters for a remote coordinator
to orchestrate and return the entire result set to the CCS coordinator as a single response.

This is the same functionality provided by synchronous CCS search using minimize_roundtrips.
Since this is an async search, it means that the async search coordinator has no visibility
into search progress on the remote clusters while they are running the search, thus losing one of
the key features of async search. However, this is a good first approach for improving overall search
latency for cross cluster searches that query a large number of shards on remote clusters, since
Kibana does not currently expose incremental progress of an async search to users.

Relates #73971
2023-06-01 10:34:16 -04:00
Armin Braun
4e69fa102f
Dry up more of index setting creation in tests (#95602)
Quick follow-up to #95569 of spots that I could automatically identify
and refactor, saving another 1.5k LoC in tests.
2023-04-27 17:11:48 +02:00
Keith Massey
b18c036761
Updating assorted integration tests to use BulkProcessor2 instead of BulkProcessor (#94172)
In https://github.com/elastic/elasticsearch/pull/91238 we rewrote
BulkProcessor to avoid deadlock that had been seen in the
IlmHistoryStore. At some point we will remove BulkProcessor altogether.
This PR ports a couple of integration tests that were using BulkProcesor
over to BulkProcessor2.
2023-03-03 13:51:12 -05:00
Nik Everett
1474d79177
Move derivative agg to module (#91014)
This cleans up the derivative pipeline agg in a few days:
1. Moves it to the `aggregations` module ala #90283
2. Drops the ceremonial interface from the result ala #82273
3. Adds comprehensive REST layer tests for it ala #26220
4. Removes some `ESIntegTestCase tests` that duplicated those in the
   `AggregatorTestCase`.
2022-10-31 10:02:57 -04:00
Christoph Büscher
feb04623e7
[Tests] Enhance multi cluster search test skipping (#85566)
Currently the "skip" section in out rest yaml tests take into account the lowest
minor version of nodes in the connected local cluster. For some multi cluster
CCS test we will also need the ability to skip certain tests based on the
connected remote cluster version, e.g. if in bwc tests some functionality isn't
available yet on some bwc versions we test against. This change adds that
ability to yaml rest test in the :qa:multi-cluster-search module.

Relates to #84481
2022-04-20 17:54:42 +02:00
Ryan Ernst
b2c9028384
Move io utils to core package (#85954)
Most classes under elasticsearch-core had been moved to the o.e.core
package. However, a couple io related classes remained in an "internal"
package. This commit moves Streams and IOUtils to the core package, as
they are no more "internal" than the rest of the classes in core.
2022-04-19 21:26:28 -07:00
Christoph Büscher
fc3890956d
Expand coverage of :qa:multi-cluster-search (#85281)
Currently this qa module runs integration tests that cover cross-cluster search
with both the local and the remote cluster on the same version. In order to also
cover cross-cluster communication across multiple versions, this change adds
additional test tasks that also start a remote cluster in all wire-compatible 
previous minor version and run the same tests against this configuration.

Relates #84481
2022-03-31 13:31:17 +02:00
Martijn van Groningen
660d9f75a9
Remove HLRC IndicesClient and related classes. (#85492)
Relates to #83423
2022-03-31 07:00:57 -04:00
Mayya Sharipova
26c3dd6857
Upgrade to lucene-9.1.0-snapshot-1336263051c (#83667)
Lucene issues that resulted in elasticsearch changes:

LUCENE-9820 Separate logic for reading the BKD index from logic to intersecting it.
LUCENE-10377: Replace 'sortPos' with 'enableSkipping' in SortField.getComparator()
LUCENE-10301: make the test-framework a proper module by moving all test
classes to org.apache.lucene.tests
LUCENE-10300: rewrite how resources are read in ukrainian morfologik analyzer:
LUCENE-10054 Make HnswGraph hierarchical
2022-02-22 09:53:20 +01:00
Mark Vieira
64929dc5df
Introduce explicit API for configure test cluster feature flags (#83876) 2022-02-14 15:22:33 -08:00
Mary Gouseti
4499050341
Use pattern matching for instanceof in plugins through qa, server/internalClusterTest (#82161) 2022-01-12 11:34:15 +01:00
Artem Prigoda
763d6d510f
Use Java 15 text blocks for JSON and multiline strings (#80751)
The ES code base is quite JSON heavy. It uses a lot of multi-line JSON requests in tests which need to be escaped and concatenated which in turn makes them hard to read. Let's try to leverage Java 15 text blocks for representing them.
2021-12-15 18:01:28 +01:00
weizijun
4d085d7551
TSDB: Bump skip version for some tests (#81707) 2021-12-14 18:11:16 +02:00
weizijun
2f855aac88
TSDB: Make time boundaries settings required in tsdb indices (#81146)
Make `index.time_series.start_time` and `index.time_series.end_time` settings as required settings in tsdb indices.

It will change many tests, among which a time_series index is created, and it will add the `index.time_series.start_time` and `index.time_series.end_time` settings
2021-12-01 17:53:49 -05:00
Mark Vieira
12ad399c48 Reformat Elasticsearch source 2021-10-27 08:19:51 -07:00
Lee Hinman
c017e1acdb
Add deprecation headers to HLRC classes (#79754)
This commit adds the @Deprecated annotation and Javadoc to HLRC classes.
2021-10-25 16:11:16 -06:00
Yannick Welsch
b84cec60d5
Fix CCSDuelIT for skipped shards (#79490)
Closes #79365
2021-10-19 20:05:47 +02:00
Christoph Büscher
dce0347c21 Mute CCSDuelIT testFieldCollapsingOneClusterHasNoResults 2021-10-18 17:47:04 +02:00
Yannick Welsch
13487b1ed6
Node level can match action (#78765)
Changes can-match from a shard-level to a node-level action, which helps avoid an explosion of shard-level can-match
subrequests in clusters with many shards, that can cause stability issues. Also introduces a new search_coordination
thread pool to handle the sending and handling of node-level can-match requests.
2021-10-18 10:13:44 +02:00
Nik Everett
b6c61f4051
Route documents to the correct shards in tsdb (#77731)
* Route documents to the correct shards in tsdb

This causes elasticsearch to land documents from the same time series on
the same shard. It does so by adding a new index setting `routing_path`
which must be set when an index is in `mode: time_series` and may not be
set outside of that mode. That setting contains a list of patterns to
extract from the `_source` document that are hashed into the routing
value.

* Moar skip

* tsdb survives full cluster restart

* Remove auto generated id rejection

We do want to reject these documents but let's sae that for a follow up
change.

* Simplify

* Forbid routing_required

* Small

* Fork fork knife

* Let failures flow

* Fix full cluster

* Always fork

* Retry?

* Remove pressure test arm

* Add missing settings

* WIP

* Remove leftover

* More cleaning

* Fixup more tests

* Remove old skip

* New tests for Retry

* More tests

* Revert unrelated

* One dispatch please

* Stuff moved

* More moving

* Explain why fork

* Back to ActionRunnable

* Update comment

* Utility method

* Move routing_path under feature flag

* Imports
2021-10-15 17:16:48 -04:00
Chris Hegarty
20c9f756d2
Fix split package org.elasticsearch.common.xcontent (#78831)
Fix the split package org.elasticsearch.common.xcontent, between server and the x-content lib. Move the x-content lib exported package from org.elasticsearch.common.xcontent to org.elasticsearch.xcontent ( following the naming convention of similar libraries ). Removing split packages is a prerequisite to modularization.
2021-10-08 17:14:26 +01:00
Nik Everett
5de59aa988
TSDB: Add feature flag to more builds (#78619)
When we run the build in non-snapshot mode we don't enable feature flags
by default. This would cause the tests for tsdb to fail. So we enable
the tsdb feature flag in every build that needs it. There were a few
builds that needed it that didn't have it. This adds it to those builds.

Closes #78443
Closes #78598
2021-10-04 10:56:23 -04:00
Valeriy Khakhutskyy
bfdd7b4cf9
Revert "Mute "tsdb" yaml test (#78599)" (#78603)
This reverts commit abdf8fe248.
2021-10-04 12:45:03 +02:00
Valeriy Khakhutskyy
abdf8fe248
Mute "tsdb" yaml test (#78599)
See #78598
2021-10-04 11:17:27 +02:00
Nik Everett
50f3784a1e
TSDB: CCS Tests (#78042)
Add some tests for cross cluster search for time_series mode indices.
2021-10-01 16:45:19 -04:00
Nikola Grcevski
23b74b0e59
[TEST] Use persistent settings in YML tests (#78480)
Use persistent instead of transient settings for various REST
YML tests, because we are deprecating the transient cluster
settings.
2021-09-30 10:59:58 -04:00
Rene Groeschke
0a2232694d
Ensure remote-cluster cluster is available when configuring tasks using it (#78397)
Fixes #78389

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-09-28 20:24:39 -04:00
Rene Groeschke
6ef13abe81
Do not create unused testCluster (#77581)
* Do not create unused testCluster

This avoids creating test clusters that are not required during the build.
We use lazy configuration here on testClusters and only instantiate them as theyre

* Do not fail on run task (debug)

* Create more test cluster lazy

* Make more test cluster lazy

* Avoid creating unused testcluster

* Fix PluginBuildPlugin

* Fix disabling geo db download

* Fix cluster setup in repository-multi-version

* Polishing

* Fix issue with irretic groovy ogic

* Fix bwc tests

* Fix more bwcTests

* Fix more bwc tests

* Fix more bwc tests

* Fix more bwc tests

* Fix typo

* Minor polishing

* Fix rolling upgrade tests

* Fix cluster config in sql qa mixedcluster project

* Fix more bwc tests

* Clean up before review

* Document test cluster usage

* Api polising after Review

provide useCluster(Provider) method to TestClusterAware

Ideally we take this a step further and realize those test clusters only on use.
But out of scope of this PR.

* Allow gradle provider as value for nonSystemProperties

* Some simplification on test configuration

* Fix typo in rest test config

* Fix more typos

* Fix another typo

* Fix more typos
2021-09-23 03:45:59 -04:00
Nik Everett
c2c0165fd2
Profile the fetch phase (#77064)
This adds profiling to the fetch phase so we can tell when fetching is
slower than we'd like and we can tell which portion of the fetch is
slow. The output includes which stored fields were loaded, how long it
took to load stored fields, which fetch sub-phases were run, and how
long those fetch sub-phases took.

Closes #75892

* Skip bwc

* Don't compare fetch profiles

* Use passed one

* no npe

* Do last rename

* Move method down

* serialization tests

* Fix sneaky serialization

* Test for sneaky bug

* license header

* Document

* Fix test

* newline

* Restore assertion

* unit test merging

* Handle inner hits

* Fixup

* Revert unneeded

* Revert inner hits profiling

* Fix names

* Fixup names

* Move results building

* Drop loaded_nested

* Checkstyle

* Fixup more

* Finish writeable cleanup

Add unit tests for merge

* Remove null checking builder

* Fix wire mistake

How did this pass before?!

* Rename

* Remove funny builder

* Remove name munging
2021-09-13 10:00:36 -04:00
Luca Cavanna
623044ed70
[TEST] CCSDuelIT to not check successful shards (#75062)
CCSDuelIT sometimes fails due to an unexpected number of shards returned in the refresh response. We create an index with a certain number of shards and no replicas, and sometimes the number of shards refresh is higher by one than the shards we created. This is not symptom of a problem though, as we are checking that there are no failures, but rather indicates a relocation happening, during which both copies of the same shard have been refreshed.

Closes #61258
Closes #72637
Closes #67754
2021-07-07 17:32:14 +02:00
Rene Groeschke
d8e4e48a3b
Avoid creating unused test tasks (#74644)
With the overall theme of trying to configure and add less to the build instead of just disabling it later,
we're replacing standalone-test by standalone-rest tasks avoids creating the
unused test tasks.

Standalone rest test plugin and the other rest test plugins behave a little bit different in the sense how source sets and test tasks are wired.

The standalone rest test plugin assumes that all RestTestTasks are using the same sourceSet (test). The yaml, java Rest test plugins use one dedicated sourceSet per test task.

In the long run we probably will migrate standalone-rest-test usages to one of the other plugins and deprecate standalone-rest-test
2021-06-30 14:11:25 +02: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
Rene Groeschke
5bcd02cb4d
Restructure build tools java packages (#72030)
Related to #71593 we move all build logic that is for elasticsearch build only into
the org.elasticsearch.gradle.internal* packages

This makes it clearer if build logic is considered to be used by external projects
Ultimately we want to only expose TestCluster and PluginBuildPlugin logic
to third party plugin authors.

This is a very first step towards that direction.
2021-04-26 14:53:55 +02:00
Lyudmila Fokina
3b0b7941ae
Warn users if security is implicitly disabled (#70114)
* Warn users if security is implicitly disabled

Elasticsearch has security features implicitly disabled by default for
Basic and Trial licenses, unless explicitly set in the configuration
file.
This may be good for onboarding, but it also lead to unintended insecure
 clusters.
 This change introduces clear warnings when security features are
 implicitly disabled.
 - a warning header in each REST response if security is implicitly
 disabled;
 - a log message during cluster boot.
2021-04-13 18:33:41 +02:00
Christoph Büscher
a413ae67e3
Propagate index errors in field_caps (#70245)
Currently we don't report any exceptions occuring during field_caps requests back to the user.
This PR adds a new failure section to the response which contains exceptions per index. 
In addition the response contains another field, `failed_indices`, with the number of indices that threw
an exception. If all of the requested indices fail, the whole request fails, otherwise the request succeeds 
and it is up to the caller to check for potential errors in the response body.

Closes #68994
2021-04-06 12:02:24 +02:00
David Turner
864ff66f68
Unique names for bulk processor scheduler threads (#69432)
Today every `BulkProcessor` creates two scheduler threads, both called
`[node-name][scheduler][T#1]`, which is also the name of the main
scheduler thread for the node. The duplicated thread names make it
harder to interpret a thread dump.

This commit makes the names of these threads distinct.

Closes #68470
2021-03-04 12:05:24 +00:00
Przemysław Witek
b7fe549a6e
Pass runtime_fields from FieldCapabilitiesRequest to FieldCapabilitiesIndexRequest (#69853) 2021-03-03 14:59:01 +01:00
Mark Vieira
a92a647b9f Update sources with new SSPL+Elastic-2.0 license headers
As per the new licensing change for Elasticsearch and Kibana this commit
moves existing Apache 2.0 licensed source code to the new dual license
SSPL+Elastic license 2.0. In addition, existing x-pack code now uses
the new version 2.0 of the Elastic license. Full changes include:

 - Updating LICENSE and NOTICE files throughout the code base, as well
   as those packaged in our published artifacts
 - Update IDE integration to now use the new license header on newly
   created source files
 - Remove references to the "OSS" distribution from our documentation
 - Update build time verification checks to no longer allow Apache 2.0
   license header in Elasticsearch source code
 - Replace all existing Apache 2.0 license headers for non-xpack code
   with updated header (vendored code with Apache 2.0 headers obviously
   remains the same).
 - Replace all Elastic license 1.0 headers with new 2.0 header in xpack.
2021-02-02 16:10:53 -08:00