Commit graph

76 commits

Author SHA1 Message Date
Moritz Mack
1f5e04b721
Migrate YAML REST tests to synthetic cluster feature check (#107068)
To simplify the migration away from version based skip checks in YAML specs, 
this PR adds a synthetic version feature `gte_vX.Y.Z` for any version at or before 8.14.0.

New test specs for 8.14 or later are expected to use respective new cluster features,
or a test-only feature supplied via ESRestTestCase#createAdditionalFeatureSpecifications
if sufficient.
2024-04-11 18:22:38 +02:00
Moritz Mack
f0b61f864f
Enable data-streams module in REST tests (#106875) 2024-03-28 17:31:50 +01:00
Ievgen Degtiarenko
4474bbd153
Expose reconciliation metrics via APM (#102244) 2023-11-16 17:58:50 +01:00
Ievgen Degtiarenko
842e563430
Add more desired balance stats (#102065)
This change expose amount of total and desired allocations reconciled during
last reroute.
2023-11-15 16:48:00 +01:00
Ievgen Degtiarenko
70ecb12556
Add undesired shard count (#101426)
This change add undesired shard (ones that are allocated not on the desired
node) counts to the api output.
2023-11-02 09:44:48 +01:00
Lee Hinman
f35cf032e8
Make the ShardsAvailabilityIndicator pluggable (#101394)
* Make the ShardsAvailabilityIndicator pluggable

This commit makes the `ShardsAvailabilityIndicator` pluggable. It currently provides the existing `ShardsAvailabilityHealthIndicatorService` (without moving it) for the `shards_availability` output in the health report API.

This will allow us in the future to provide a separate `shards_availability` plugin to override the way that health is reported for shards.
2023-10-27 08:02:41 -06:00
Andrei Dan
01ed7de99f
GA the data stream lifecycle (#98644)
This makes the data stream lifecycle generally available. This will allow
data streams to take advantage of a native simplified and resilient
lifecycle implementation.
2023-08-21 17:28:54 +01:00
Carlos Delgado
375991d974
Remove synonyms feature flag and related classes (#97962) 2023-07-26 18:13:06 +02:00
Carlos Delgado
2412adf0fa
Fix synonyms API analyzers reloading (#97621) 2023-07-13 14:28:28 +02:00
Mary Gouseti
a432313ff3
Data stream lifecycle class names (#97381) 2023-07-05 12:28:32 +03:00
Carlos Delgado
39b7b5eb56
Synonym Mgmnt API: PUT request (#95895) 2023-05-31 10:48:56 +02:00
Ievgen Degtiarenko
c2c0ced9b1
Reset desired balance (#94525)
This introduces an endpoint to reset the desired balance.
It could be used if computed balance diverged from the actual one a lot 
to start a new computation from the current state.
2023-04-20 08:03:48 +02:00
Andrei Dan
22255ed7d0
Enable DLM feature for smoke tests (#95215) 2023-04-13 12:25:23 +01:00
David Turner
4ef9965d47
Report transport message size per action (#94543)
Adds to the transport stats a histogram of transport message sizes for
each transport action.

Closes https://github.com/elastic/elasticsearch/issues/88151
2023-03-28 12:05:18 -04:00
Ievgen Degtiarenko
21adad38a3
Add data tier to /_internal/desired-balance (#94496) 2023-03-20 10:44:55 +01:00
Ievgen Degtiarenko
90d017ae09
Add cluster_info to the GET /_internal/desired-balance endpoint output (#94272) 2023-03-06 13:57:55 +01:00
Ievgen Degtiarenko
e887c97282
Fix desired balance spec (#93617)
Spec relied on a presence of a node with `test-cluster-0` name.
This change reads the name from the cluster state instead.
2023-02-09 11:37:04 +01:00
Ievgen Degtiarenko
ab5ae88919
Expose forecasted and actual disk usage per tier and node (#93497) 2023-02-06 13:34:18 +01:00
Ievgen Degtiarenko
513dc2f24f
Expose per node counts (#93439) 2023-02-02 16:13:01 +01:00
Mark Vieira
67f0dfe4cf
Used a shared repo path for all nodes of a given cluster (#93006) 2023-01-17 13:39:02 -08:00
Mark Vieira
c7648c2be9
Convert smoke test multinode (#92774) 2023-01-10 08:51:04 -08:00
Ievgen Degtiarenko
22a1ba7b43
Expose tier balancing stats via internal endpoint (#92199) 2023-01-09 10:57:10 +01:00
Mark Vieira
c2eda511de
Add JUnit rule based integration test cluster orchestration framework (#92379)
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-21 15:33:46 -08:00
Keith Massey
64a52ce18f
Forwarding simulate calls to ingest nodes (#92171)
Calls to the simulate pipeline API are now forwarded to an ingest node. If there is no ingest node,
the request now fails.
2022-12-08 08:49:12 -06:00
Artem Prigoda
79ca59bc96
DesiredBalance: expose it via _internal/desired_balance (#91038)
Add an internal endpoint for exposed the desired balance and computation stats at a master node as GET _internal/desired_balance and returns
```
{
  "stats": {
    "computation_active": false,
    "computation_submitted": 5,
    "computation_executed": 5,
    "computation_converged": 5,
    "computation_iterations": 4,
    "computation_converged_index": 4,
    "computation_time_in_millis": 0,
    "reconciliation_time_in_millis": 0
  },
  "routing_table": {
    "test": {
      "0": {
        "current": [
          {
            "state": "STARTED",
            "primary": true,
            "node": "UPYt8VwWTt-IADAEbqpLxA",
            "node_is_desired": true,
            "relocating_node": null,
            "relocating_node_is_desired": false,
            "shard_id": 0,
            "index": "test"
          }
        ],
        "desired": {
          "node_ids": [
            "UPYt8VwWTt-IADAEbqpLxA"
          ],
          "total": 1,
          "unassigned": 0,
          "ignored": 0
        }
      },
      "1": {
        "current": [
          {
            "state": "STARTED",
            "primary": true,
            "node": "2x1VTuSOQdeguXPdN73yRw",
            "node_is_desired": true,
            "relocating_node": null,
            "relocating_node_is_desired": false,
            "shard_id": 1,
            "index": "test"
          }
        ],
        "desired": {
          "node_ids": [
            "2x1VTuSOQdeguXPdN73yRw"
          ],
          "total": 1,
          "unassigned": 0,
          "ignored": 0
        }
      }
    }
  }
}
```

Fixes #90583
2022-11-16 02:54:10 +01:00
Rene Groeschke
5604f80958
Port QA projects to use javaRestTest and yamlRestTest (#86703)
Do not use deprecated elasticsearch.rest-test plugin
2022-05-12 11:32:07 +02:00
Benjamin Trent
b592d2bf01
New random_sampler aggregation for sampling documents in aggregations (#84363)
This adds a new sampling aggregation that performs a background sampling over all documents in an index. 

The syntax is as follows:
```
{
  "aggregations": {
    "sampling": {
      "random_sampler": {
        "probability": 0.1
      },
      "aggs": {
        "price_percentiles": {
          "percentiles": {
            "field": "taxful_total_price"
          }
        }
      }
    }
  }
}
```

This aggregation provides fast random sampling over the entire document set in order to speed up costly aggregations.

Testing this over a variety of aggregations and data sets, the median speed up when sampling at `0.001` over millions of documents is around 70X speed improvement.

Relative error rate does rely on the size of the data and the aggregation kind. Here are some typically expected numbers when sampling over 10s of millions of documents. `p` is the configured probability and `n` is the number of documents matched by your provided filter query.
2022-03-02 14:32:30 -05: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
Benjamin Trent
73b323e6fa
Fixing random_sampler tests (#83549)
Fixes smoke tests my enabling the random_sampler agg

Fixes flakey sampler test

closes #83523

closes #83357
2022-02-07 08:34:37 -05: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
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
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
962976b045
Add index.mode: time_series (#77626)
This adds a setting to enable time series mode that is hidden by the
`es.index_mode_feature_flag_registered` feature flag. All it does right
now is make sure you haven't configured index sorting and partitioning.
This gives us a place to "hang" all of our further work on time series
mode.

Time series mode will entirely take over index sorting. We don't believe
you'll ever be able to configure sorting yourself when you are in time
series mode. We don't expect time series mode to support index
partitioning when we first build it but we'd like to get there.
2021-09-14 12:47:44 -04: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
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
Rene Groeschke
24adbbca41
Remove OSS specific distribution packaging (#69775)
* Remove OSS projects from distribution packaging
* Remove OSS flavor from ElasticsearchDistribution
* Remove OSS handling from docker build setup
2021-03-03 13:39:29 +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
Rene Groeschke
97749a3372
Port rest integ tests to use task avoidance api (#65011)
This ports the majority of the rest integ tests tasks to use the task avoidance api.

- There are some edge cases left that we need to investigate, but we can do that separately.
2020-11-26 10:30:06 +01:00
Rene Groeschke
dd74be0f83
Merge test runner task into RestIntegTest (#60261)
* Merge test runner task into RestIntegTest
* Reorganizing Standalone runner and RestIntegTest task
* Rework general test task configuration and extension
2020-08-03 12:07:41 +02:00
Jake Landis
333a5d8cdf
Create plugin for yamlTest task (#56841)
This commit creates a new Gradle plugin to provide a separate task name
and source set for running YAML based REST tests. The only project
converted to use the new plugin in this PR is distribution/archives/integ-test-zip.
For which the testing has been moved to :rest-api-spec since it makes the most
sense and it avoids a small but awkward change to the distribution plugin.

The remaining cases in modules, plugins, and x-pack will be handled in followups.

This plugin is distinctly different from the plugin introduced in #55896 since
the YAML REST tests are intended to be black box tests over HTTP. As such they
should not (by default) have access to the classpath for that which they are testing.

The YAML based REST tests will be moved to separate source sets (yamlRestTest).
The which source is the target for the test resources is dependent on if this
new plugin is applied. If it is not applied, it will default to the test source
set.

Further, this introduces a breaking change for plugin developers that
use the YAML testing framework. They will now need to either use the new source set
and matching task, or configure the rest resources to use the old "test" source set that
matches the old integTest task. (The former should be preferred).

As part of this change (which is also breaking for plugin developers) the
rest resources plugin has been removed from the build plugin and now requires
either explicit application or application via the new YAML REST test plugin.

Plugin developers should be able to fix the breaking changes to the YAML tests
by adding apply plugin: 'elasticsearch.yaml-rest-test' and moving the YAML tests
under a yamlRestTest folder (instead of test)
2020-07-06 12:13:01 -05:00
Lee Hinman
984670b34d
Set feature flags for IndexTemplatesV2 and Data Streams in top… (#53897)
Resolves #53892
2020-03-20 15:11:49 -06:00
Martijn van Groningen
12046084f9
Initial data stream commit (#53666)
* Initial data stream commit

This commits adds a data stream feature flag, initial definition of a data stream and
the stubs for the data stream create, delete and get APIs. Also simple serialization
tests are added and a rest test to thest the data stream API stubs.

This is a large amount of code and mainly mechanical, but this commit should be
straightforward to review, because there isn't any real logic.

The data stream transport and rest action are behind the data stream feature flag and
are only intialized if the feature flag is enabled. The feature flag is enabled if
elasticsearch is build as snapshot or a release build and the
'es.datastreams_feature_flag_registered' is enabled.

The integ-test-zip sets the feature flag if building a release build, otherwise
rest tests would fail.

Relates to #53100

* fixed hlrc test

* ignore bwc until this change has been backported to 7.x branch

* changed data stream apis to be a cluster based action.

before this commit the data steams api were indices based actions,
but data streams aren't indices, data streams encapsulates indices,
but are indices themselves. It is a cluster level attribute, and
therefor cluster based action fits best for now.

Perhaps in the future we will have data stream based actions and
then this would be a right fit for the data stream crud apis.

* this should have been part of the previous commit

* fixed yaml test

* Also add feature flag in other modules that run the yaml test if a release build is executed

* Reverted the commits that make data stream a cluster based api

This reverts commit e362eeb669.

* Make data stream crud apis work like a indices based api.

* renamed timestamp field

* fixed compile error after merging in master

* fixed merge mistake

* moved setting system property

* applied review comments
2020-03-20 11:22:18 +01:00
Lee Hinman
d47d74a558
Fix feature flag setting for ComponentTemplate APIs (#53758)
The feature flag was set for *most* of the builds, but there are a couple where it was missing.

Resolves #53708
2020-03-19 08:00:06 -06:00
Jake Landis
810dc9fce3
Smarter copying of the rest specs and tests (#52114)
This PR addresses the unnecessary copying of the rest specs and allows
for better semantics for which specs and tests are copied. By default 
the rest specs will get copied if the project applies 
`elasticsearch.standalone-rest-test` or `esplugin` and the project 
has rest tests or you configure the custom extension `restResources`. 

This PR also removes the need for dozens of places where the x-pack 
specs were copied by supporting copying of the x-pack rest specs too. 

The plugin/task introduced here can also copy the rest tests to the 
local project through a similar configuration.

The new plugin/task allows a user to minimize the surface area of 
which rest specs are copied. Per project can be configured to include 
only a subset of the specs (or tests). Configuring a project to only 
copy the specs when actually needed should help with build cache hit 
rates since we can better define what is actually in use. 
However, project level optimizations for build cache hit rates are 
not included with this PR.

Also, with this PR you can no longer use the includePackaged flag on 
integTest task.  

The following items are included in this PR:
* new plugin: `elasticsearch.rest-resources` 
* new tasks: CopyRestApiTask and CopyRestTestsTask - performs the copy 
* new extension 'restResources'
```
restResources {
  restApi {
    includeCore 'foo' , 'bar' //will include the core specs that start with foo and bar
    includeXpack 'baz' //will include x-pack specs that start with baz
  }
  restTests {
    includeCore 'foo', 'bar' //will include the core tests that start with foo and bar
    includeXpack 'baz' //will include the x-pack tests that start with baz
  }
}

```
2020-02-25 18:46:32 -06:00
Rory Hunter
3a3e5f6176
Apply 2-space indent to all gradle scripts (#48849)
Closes #48724. Update `.editorconfig` to make the Java settings the default
for all files, and then apply a 2-space indent to all `*.gradle` files.
Then reformat all the files.
2019-11-13 10:14:04 +00:00
Alpar Torok
05560c77bd
Testclusters: convert left-overs from checkPart1 (#43370)
* Testclusters: convert left-overs from checkPart1
2019-06-25 18:46:52 +03:00
Ryan Ernst
9a34b20233
Simplify integ test distribution types (#37618)
The integ tests currently use the raw zip project name as the
distribution type. This commit simplifies this specification to be
"default" or "oss". Whether zip or tar is used should be an internal
implementation detail of the integ test setup, which can (in the future)
be platform specific.
2019-01-21 12:37:17 -08:00