Commit graph

2485 commits

Author SHA1 Message Date
Luke Whiting
64e8659845
#104411 Add warning headers for ingest pipelines containing special characters (#114837)
* Add logs and headers

For pipeline creation when name is invalid

* Fix YAML tests and add YAML test for warnings

* Update docs/changelog/114837.yaml

* Changelog entry

* Changelog entry

* Update docs/changelog/114837.yaml

* Changelog entry
2024-10-16 08:58:13 +01:00
David Turner
97c207c59b
Remove all replaced-in-v8 REST endpoints (#114800)
These endpoints were deprecated in v7 and are replaced in v8 with
different endpoints so we can remove the v7 endpoint names in v9.
2024-10-16 02:06:35 +11:00
Mariusz Józala
075cd24043
[TEST] Fix ccs-unavailable-clusters QA tests build (#114833)
Properly use `configureEach` on the task configuration to postpone the
tasks creation and configuration in the build process
2024-10-15 16:48:27 +02:00
Mariusz Józala
551a7d6d94
[TEST] Migrated ccs-unavailable-clusters QA tests (#114764)
Ccs-unavailable-clusters QA tests migrated to the new REST testing
framework, using 'elasticsearch.internal-java-rest-test' Gradle plugin
2024-10-15 11:59:49 +02:00
Martijn van Groningen
e833e7b6c4
Add feature flag for subobjects auto (#114616) 2024-10-12 18:55:27 +02:00
Rene Groeschke
f1f5ee06a3
Replace cloud-ess docker image with wolfi-ess (#114413)
* Replace cloud-ess docker image with wolfi-ess
   We just replaced the existing implementation of cloud-ess with what was wolfi-ess which is a wolfi based ess image. 
   The cloud image itself will be removed in a future commit it was not used anywhere

* Switch to test cloud docker image instead of default docker in packaging pr tests. 
  This adds way more coverage than the default docker image which is also barely touched
2024-10-11 21:58:15 +02:00
Martijn van Groningen
8e3b3aa1a5
No longer require logs@settings component template to enable logsdb by default. (#114501)
This change also opts out apm logs from logsdb.
2024-10-10 20:12:17 +02:00
Keith Massey
fb482f863d
Adding index_template_substitutions to the simulate ingest API (#114128)
This adds support for a new `index_template_substitutions` field to the
body of an ingest simulate API request. These substitutions can be used
to change the pipeline(s) used for ingest, or to change the mappings
used for validation. It is similar to the
`component_template_substitutions` added in #113276. Here is an example
that shows both of those usages working together:

```
## First, add a couple of pipelines that set a field to a boolean:
PUT /_ingest/pipeline/foo-pipeline?pretty
{
  "processors": [
    {
      "set": {
        "field": "foo",
        "value": true
      }
    }
  ]
}

PUT /_ingest/pipeline/bar-pipeline?pretty
{
  "processors": [
    {
      "set": {
        "field": "bar",
        "value": true
      }
    }
  ]
}

## Now, create three component templates. One provides a mapping enforces that the only field is "foo"
## and that field is a keyword. The next is similar, but adds a `bar` field. The final one provides a setting
## that makes "foo-pipeline" the default pipeline.
## Remember that the "foo-pipeline" sets the "foo" field to a boolean, so using both of these templates
## together would cause a validation exception. These could be in the same template, but are provided
## separately just so that later we can show how multiple templates can be overridden.
PUT _component_template/mappings_template
{
  "template": {
    "mappings": {
      "dynamic": "strict",
      "properties": {
        "foo": {
          "type": "keyword"
        }
      }
    }
  }
}

PUT _component_template/mappings_template_with_bar
{
    "template": {
      "mappings": {
        "dynamic": "strict",
        "properties": {
          "foo": {
            "type": "keyword"
          },
          "bar": {
            "type": "boolean"
          }
        }
      }
    }
}

PUT _component_template/settings_template
{
  "template": {
    "settings": {
      "index": {
        "default_pipeline": "foo-pipeline"
      }
    }
  }
}

## Here we create an index template  pulling in both of the component templates above
PUT _index_template/template_1
{
  "index_patterns": ["foo*"],
  "composed_of": ["mappings_template", "settings_template"]
}

## We can index a document here to create the index, or not. Either way the simulate call ought to work the same
POST foo-1/_doc
{
  "foo": "FOO"
}

## This will not blow up with validation exceptions because the substitute "index_template_substitutions"
## uses `mappings_template_with_bar`, which adds the bar field.
## And the bar-pipeline is executed rather than the foo-pipeline because the substitute
## "index_template_substitutions" uses a substitute `settings_template`, so the value of "foo"
## does not get set to an invalid type.
POST _ingest/_simulate?pretty&index=foo-1
{
  "docs": [
    {
      "_id": "asdf",
      "_source": {
        "foo": "foo",
        "bar": "bar"
      }
    }
  ],
  "component_template_substitutions": {
    "settings_template": {
      "template": {
        "settings": {
          "index": {
            "default_pipeline": "bar-pipeline"
          }
        }
      }
    }
  },
  "index_template_substitutions": {
    "template_1": {
      "index_patterns": ["foo*"],
      "composed_of": ["mappings_template_with_bar", "settings_template"]
    }
  }
}
```
2024-10-09 10:15:37 +11:00
Simon Cooper
cbde7f456d
Add a size limit to outputs from mustache (#114002) 2024-10-08 11:42:22 +01:00
David Turner
07c3acf1c0
Remove cluster state from /_cluster/reroute response (#114231)
Including the cluster state in responses to the `POST _cluster/state`
API  was deprecated in #90399 (v8.6.0) requiring callers to pass
`?metric=none` to avoid the deprecation warning. This commit adjusts the
behaviour as promised in v9 so that this API never returns the cluster
state, and deprecates the `?metric` parameter itself.

Closes #88978
2024-10-08 07:59:57 +01:00
Lorenzo Dematté
fcdfa5b18e
Remove some easy/straightforward instances of UpdateForV9 (#114134) 2024-10-04 17:07:35 +02:00
Keith Massey
89978229f7
Simplifying the way the simulate ingest API uses component template substitutions for pipeline lookup and mapping validation (#113908) 2024-10-04 07:40:55 -05:00
Rene Groeschke
54c83d7fa7
Add wolfi ess docker image (#113810) 2024-10-04 11:01:49 +02:00
David Turner
1a92975d29
Remove obsolete tests in v9 (#113946) 2024-10-03 13:07:29 +01:00
David Turner
cd427198dc
More verbose logging in IndicesSegmentsRestCancellationIT (#113844)
Relates #88201
2024-10-03 19:53:47 +10:00
Tim Brooks
6759ae2e89
Introduce watermarks for indexing pressure backoff (#113912)
Currently we have a relatively basic decider about when to throttling
indexing. This commit adds two levels of watermarks with configurable
bulk size deciders. Additionally, adds additional settings to control
primary, coordinating, and replica rejection limits.
2024-10-02 10:06:33 -06:00
David Turner
81bd8667cb
Define owners for UpdateForV9 annotations (#113926)
In order to better track the work needed to prepare this branch for the
major version upgrade, this commit adds a mandatory `owner` field to all
`UpdateForV9` (and `UpdateForV10`) annotations.
2024-10-02 11:37:14 +01:00
Chris Hegarty
32dde26e49
Upgrade to Lucene 9.12.0 (#113333)
This commit upgrades to Lucene 9.12.0.

Co-authored-by: Adrien Grand <jpountz@gmail.com>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
Co-authored-by: Chris Hegarty <chegar999@gmail.com>
Co-authored-by: John Wagster <john.wagster@elastic.co>
Co-authored-by: Luca Cavanna <javanna@apache.org>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
2024-10-01 08:39:27 +01:00
Armin Braun
99830f92ca
Move more test-only x-content parsing logic out of production codebase (#113774)
Just moving over a few more since they're not used in production code any longer.
2024-09-30 14:47:28 +02:00
David Turner
e9d0dd9e28
Fix testClusterHealthRestCancellation (#113680)
This test was failing due to a race between an early cancellation check
and the cancel operation. With this commit we wait until the action is
definitely blocked before cancelling the task.

Closes #100062
2024-09-30 07:47:09 +01:00
Keith Massey
8259111fe0
fixing a typo in 80_ingest_simulate.yml 2024-09-26 18:56:40 -05:00
Brian Seeders
fba8045d99
[docker] Rename -ubi8 suffix to -ubi (#112884)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-26 15:57:50 -04:00
David Turner
ade235bf0f
Wait for logs in tests without busy-waiting (#113589)
Introduces `MockLog#awaitAllExpectationsMatched` to allow tests to wait
until all the expected log messages have been seen without having to use
`assertBusy()`.
2024-09-26 16:10:39 +01:00
Brian Seeders
e9b303322c
Fix packaging tests after addition of new wolfi-based image (#112831)
* Add more missing wolfi references to fix tests
* packaging tests require access to docker registry
* Fix symlink for es distributions jdk cacerts in wolfi docker
* Fix native support on wolfi images
* Fix provided keystore packaging tests for wolfi
* Add utils used for testing to wolfi image
* Explicitly set default shell to bash in docker images
* Fix docker config issues
* Apply review feedback around docker login

---------

Co-authored-by: Rene Groeschke <rene@elastic.co>
2024-09-26 11:11:01 +02:00
Keith Massey
cd950bb2fa
Adding component template substitutions to the simulate ingest API (#113276) 2024-09-25 15:30:22 -05:00
Tim Brooks
d146b27a26
Default incremental bulk functionality to false (#113416)
This commit flips the incremental bulk setting to false. Additionally,
it removes some test code which intermittently causes issues with
security test cases.
2024-09-24 06:26:48 +10:00
Tim Brooks
c5caf84e2d
Move raw path into HttpPreRequest (#113231)
Currently, the raw path is only available from the RestRequest. This
makes the logic to determine if a handler supports streaming more
challenging to evaluate. This commit moves the raw path into pre request
to allow easier streaming support logic.
2024-09-21 05:32:45 +10:00
David Turner
6ff138f558
Drop useless AckedRequest interface (#113255)
Almost every implementation of `AckedRequest` is an
`AcknowledgedRequest` too, and the distinction is rather confusing.
Moreover the other implementations of `AckedRequest` are a potential
source of `null` timeouts that we'd like to get rid of. This commit
simplifies the situation by dropping the unnecessary `AckedRequest`
interface entirely.
2024-09-20 12:33:07 +01:00
Luca Cavanna
ae7cd5e008
Replace MappedFieldType#extractTerm with local query visitor (#113163)
The only usage of `MappedFieldType#extractTerm` comes from `SpanTermQueryBuilder`
which attempts to extract a single term from a generic Query obtained from calling
`MappedFieldType#termQuery`. We can move this logic directly within its only caller,
and instead of using instanceof checks, we can rely on the query visitor API.

This additionally allows us to remove one of the leftover usages of TermInSetQuery#getTermData
which is deprecated in Lucene
2024-09-20 09:55:36 +02:00
Tim Brooks
92daeeba11 Properly handle empty incremental bulk requests (#112974)
This commit ensures we properly throw exceptions when an empty bulk
request is received with the incremental handling enabled.
2024-09-18 13:52:10 -06:00
Mikhail Berezovskiy
dce8a0bfd3 merge main 2024-09-18 13:52:10 -06:00
Tim Brooks
95b42a7129 Ensure incremental bulk setting is set atomically (#112479)
Currently the rest.incremental_bulk is read in two different places.
This means that it will be employed in two steps introducing
unpredictable behavior. This commit ensures that it is only read in a
single place.
2024-09-18 13:40:39 -06:00
Tim Brooks
a03fb12b09 Incremental bulk integration with rest layer (#112154)
Integrate the incremental bulks into RestBulkAction
2024-09-18 13:40:39 -06:00
Lee Hinman
b94720dca5
Deprecate dot-prefixed indices and composable template index patterns (#112571)
This commit adds a module emitting a deprecation warning when a
dot-prefixed index is manually or automatically created, or when a
composable index template with an index pattern that uses a dot-prefix
is created. This pattern warns that in the future these indices will not
be allowed. In a future breaking change (10.0.0 maybe?) the deprecation
can then be changed to an exception.

These deprecations are only displayed when a non-operator user is using
the API (one that does not set the `X-elastic-product-origin` header).
2024-09-19 05:29:53 +10:00
Luca Cavanna
bb78a28c4a
Remove index.mapper.dynamic setting (#113000)
This setting had been removed in the past, it was reintroudced for bw comp with 7.x with #109341. It can now be removed from main as it no longer supports indices created with 7.x
2024-09-18 10:10:44 +02:00
Mark Vieira
a59c182f9f
Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
Mark Vieira
4ce661cc48
Bump Elasticsearch version to 9.0.0 (#112570) 2024-09-11 09:40:11 -07:00
Keith Massey
66303ab5e4
Fixing a simulate ingest yaml rest test (#112686) 2024-09-10 08:54:46 -05:00
David Turner
8f07d60c2c
Fix trappy timeouts in o.e.a.a.cluster.* (#112674)
Removes all usages of `TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT` in
cluster-related APIs in `:server`.

Relates #107984
2024-09-10 08:17:09 +01:00
Keith Massey
4aa3c3d7ee
Add support for templates when validating mappings in the simulate ingest API (#111161) 2024-09-05 09:25:53 -05:00
Simon Cooper
a36d90cf34
Use CLDR locale provider on JDK 23+ (#110222)
JDK 23 removes the COMPAT locale provider, leaving CLDR as the only option. This commit configures Elasticsearch
to use the CLDR provider when on JDK 23, but still use the existing COMPAT provider when on JDK 22 and below.

This causes some differences in locale behaviour; this also adapts various tests to still work whether run on COMPAT or CLDR.
2024-09-04 13:42:40 +01:00
Ryan Ernst
0cf9c54f65
Fix windows memory locking (#111866)
Memory locking on Windows with the bundled jdk was broken by native
access refactoring. This commit fixes the linking issue, as well as adds
a packaging test to ensure memory locking is invoked on all supported
platforms.
2024-08-15 12:00:41 -07:00
Simon Cooper
ff045118e1
Skip on any instance of node or version features being present (#111268)
Update features skip behavior to skip on any node having the feature, not all nodes
2024-08-07 10:36:59 +01:00
Armin Braun
bf7be8e23a
Save 400 LoC in tests by using indexSettings shortcut (#111573)
It's in the title, randomly saw a bunch of spots where we're
not using the shortcut, figured I'd clean this up quickly to save ~400 lines.
2024-08-05 10:21:13 +02:00
Oleksandr Kolomiiets
5e6c2e533c
Fix LogsIndexModeFullClusterRestartIT (#111362) 2024-07-29 12:34:32 -07:00
Salvatore Campagna
2fa5400e23
Test LogsDB backward compatibility (#110180)
Test LogsDB backward compatibility with a rolling upgrade and full cluster restart.
We try to start indexing logs using a `standard` index, then we switch to a `LogsDB` index.
We also improve the existing test which switches between the two index modes, `standard`
and `logs`.
2024-07-25 15:15:27 +02:00
Mark Vieira
acb5ab1134
Make ConfigurationTests.test20HostnameSubstitution more resilient (#111216)
This is an attempt to fix occasional test failures where asserting on a
request response fails because the cluster has not finished
initialization and cannot yet serve requests.

Closes #109660
2024-07-24 09:27:26 +10:00
Mark Vieira
ce3bc5db13
Make docker packaging test more resilient (#111205)
Wrap check for container shutdown log message in an `assertBusy()` to
deal with race conditions.

Closes #111132
2024-07-24 04:41:28 +10:00
Mark Vieira
943c12abe1
Unmute DockerTests.test600Interrupt (#111165)
Investigating https://github.com/elastic/elasticsearch/issues/111132 and
it seems this test has been muted on `main` for some time. Let's unmute,
to see if this is specific to the 7.17 branch or not.
2024-07-23 04:35:55 +10:00
Simon Cooper
ede4038827
Fix FileSettingsUpgradeIT to not create irrelevant clusters at all (#110963) 2024-07-17 12:00:06 +01:00