Commit graph

8253 commits

Author SHA1 Message Date
Keith Massey
bea8da1c97
Fixing GetDatabaseConfigurationAction response serialization (#119233) (#119471)
Co-authored-by: Joe Gallo <joe.gallo@elastic.co>
2025-01-03 06:07:35 +11:00
Rene Groeschke
4d17b2193a
Update Gradle wrapper to 8.12 (#118683) (#119357)
This updates the gradle wrapper to 8.12

We addressed deprecation warnings due to the update that includes:

- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions

(cherry picked from commit ba61f8c7f7)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerCloudElasticsearchDistributionType.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/Fixture.java
#	plugins/repository-hdfs/hadoop-client-api/build.gradle
#	server/src/main/java/org/elasticsearch/inference/ChunkingOptions.java
#	x-pack/plugin/kql/build.gradle
#	x-pack/plugin/migrate/build.gradle
#	x-pack/plugin/security/qa/security-basic/build.gradle
2024-12-31 08:37:28 +01:00
Joe Gallo
78fb1ec970
Fix log message format bugs (#118354) (#118387) 2024-12-11 08:59:16 +11:00
Stanislav Malyshev
a07433731d
Fix reconstituting version string from components (#117213) (#117952)
* Fix reconstituting version string from components

Co-authored-by: Joe Gallo <joegallo@gmail.com>
(cherry picked from commit 28eda97ddd)
2024-12-04 13:56:05 -07:00
Nhat Nguyen
ff4531d2e9
Acquire stats searcher for data stream stats (#117953) (#118004)
Here, we only need to extract the minimum and maximum values of the 
timestamp field; therefore, using a stats searcher should suffice. This
is important for frozen indices.
2024-12-04 08:56:45 -08:00
Rene Groeschke
581b9ab7c0
[8.16] [Gradle] Remove static use of BuildParams (#115122) (#117434)
* [Gradle] Remove static use of BuildParams (#115122)

Static fields dont do well in Gradle with configuration cache enabled.

- Use buildParams extension in build scripts
- Keep BuildParams.ci for now for easy serverless migration
-  Tweak testing doc

(cherry picked from commit 13c8aaeffa)

# Conflicts:
#	TESTING.asciidoc
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build.gradle
#	modules/ingest-geoip/qa/full-cluster-restart/build.gradle
#	qa/mixed-cluster/build.gradle
#	x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle
#	x-pack/plugin/eql/qa/rest/build.gradle
#	x-pack/plugin/fleet/qa/rest/build.gradle
#	x-pack/plugin/kql/build.gradle
#	x-pack/plugin/mapper-unsigned-long/build.gradle
#	x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle
#	x-pack/plugin/security/qa/multi-cluster/build.gradle
#	x-pack/plugin/sql/qa/jdbc/build.gradle
#	x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle

* Fix merge

* [Build] Fix fips testing after buildparams rework (#116934)

* More Cleanup

* [Build] Fix checkstyle exclusions on windows (#115185)

* More merge fixes

* Delete x-pack/plugin/kql/build.gradle
2024-11-27 12:34:32 +01:00
Jan Kuipers
6f3d15296a
Propagate scoring function through random sampler (#116957) (#117165)
* Propagate scoring function through random sampler.

* Update docs/changelog/116957.yaml

* Correct score mode in random sampler weight

* Fix random sampling with scores and p=1.0

* Unit test with scores

* YAML test

* Add capability
2024-11-21 03:03:55 +11:00
Yang Wang
18fe9d5543
Skip FIPS JVMs in testReloadCredentialsFromKeystore (#116814) (#117100)
This test doesn't need to run in FIPS mode, and apparently it fails
sometimes, so with this commit we skip it.

Closes #116811

(cherry picked from commit ea90fbc10d)

# Conflicts:
#	muted-tests.yml

Co-authored-by: David Turner <david.turner@elastic.co>
2024-11-20 09:28:09 +11:00
David Turner
771bea1e37
Add end-to-end test for reloading S3 credentials (#116994)
We don't seem to have a test that completely verifies that a S3
repository can reload credentials from an updated keystore. This commit
adds such a test.

Backport of #116762 to 8.16.
2024-11-19 09:30:22 +11:00
David Turner
a8e616f937
Improve message about insecure S3 settings (#116955)
Clarifies that insecure settings are stored in plaintext and must not be
used. Also removes the mention of the (wrong) system property from the
error message if insecure settings are not permitted.

Backport of #116915 to `8.16`
2024-11-18 18:41:18 +00:00
Yang Wang
d4d71417f6
fix trappy http stream tests (#116829) (#116905)
(cherry picked from commit 94897268b3)

# Conflicts:
#	modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/http/netty4/Netty4IncrementalRequestHandlingIT.java
#	modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpRequestBodyStream.java
#	muted-tests.yml

Co-authored-by: Mikhail Berezovskiy <mikhail@elastic.co>
2024-11-18 17:01:44 +11:00
Jake Landis
3aa26ab364
Bump Netty to 4.1.115.Final (#116696) (#116758)
This commit bumps Netty from 4.1.109.Final to 4.1.115.Final

(cherry picked from commit b42dbab0a4)
2024-11-14 05:01:41 +11:00
Benjamin Trent
6e9e2b4bdd
char_filter pattern_replace error requires at least java 21 (#116507) (#116597)
This test requires at least java 21, skip it otherwise.

closes: https://github.com/elastic/elasticsearch/issues/116405 closes:
https://github.com/elastic/elasticsearch/issues/116134
(cherry picked from commit 91b4b1e4e4)
2024-11-12 02:50:29 +11:00
Lee Hinman
395482e853
[8.16] Align dot prefix validation with Serverless (#116266) (#116287)
* Align dot prefix validation with Serverless (#116266)

This aligns the deprecation warnings for on-prem dot-prefixed indices to
be the same as the Serverless validation. It adds exemptions for the
`.entities…` indices, and makes the list a dynamic setting.

(cherry picked from commit 72aa17a0c3)

* Fix compilation

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-08 09:27:58 +11:00
David Turner
2532b8c29c
Handle status code 0 in S3 CMU response (#116212) (#116231)
A `CompleteMultipartUpload` action may fail after sending the `200 OK`
response line. In this case the response body describes the error, and
the SDK translates this situation to an exception with status code 0 but
with the `ErrorCode` string set appropriately. This commit enhances the
exception handling in `S3BlobContainer` to handle this possibility.

Closes #102294

Co-authored-by: Pat Patterson <metadaddy@gmail.com>
2024-11-05 21:29:53 +11:00
Parker Timmins
30a62ef2c0
Ignore warning on yaml test put template (#116201)
Ignore warnings in recently added tests. The underlying issue was fixed on main in #115799 . Rather than backport the larger fix, we can ignore the warning in yaml tests.
2024-11-04 14:30:22 -06:00
Parker Timmins
ba80c4cabc
[8.16] Resolve pipelines from template if lazy rollover write (#116031) (#116131)
* Resolve pipelines from template if lazy rollover write  (#116031)

If datastream rollover on write flag is set in cluster state, resolve pipelines from templates rather than from metadata. This fixes the following bug: when a pipeline reroutes every document to another index, and rollover is called with lazy=true (setting the rollover on write flag), changes to the pipeline do not go into effect, because the lack of writes means the data stream never rolls over and pipelines in metadata are not updated. The fix is to resolve pipelines from templates if the lazy rollover flag is set. To improve efficiency we only resolve pipelines once per index in the bulk request, caching the value, and reusing for other requests to the same index.

Fixes: #112781

* Remute tests blocking merge

* Remute tests blocking merge
2024-11-03 04:12:06 +11:00
Slobodan Adamović
db255ec228
Remove optional transitive tink and protobuf-java dependencies (#115916) (#115954)
This commit removes `com.google.crypto.tink` which is transitive and optional dependency of `oauth2-oidc-sdk` and `nimbus-jose-jwt`. We don't seem to be using any functionality that requires `tink` and thus `protobuf-java`. Removing them feels safer than having to maintain misaligned versions.

(cherry picked from commit 6b32bced36)
2024-10-31 03:28:15 +11:00
Keith Massey
e7b5076db0
Adding testUsedMaxMindResponseClassesAreAccountedFor back to MaxMindSupportTests (#115706) (#115780) 2024-10-29 02:48:52 +11:00
Keith Massey
e627e601c6
Fixing DatabaseNodeServiceIT testNonGzippedDatabase and testGzippedDatabase race condition (#115463) (#115708)
Co-authored-by: Joe Gallo <joegallo@gmail.com>
2024-10-26 10:24:49 +11:00
Keith Massey
709794627c
Adding additional checks for IPInfo results (#115481) (#115694) 2024-10-26 07:52:39 +11:00
Yang Wang
9f0551a578
[8.16] [Test] Flush response body for progress (#115177) (#115613)
* [Test] Flush response body for progress (#115177)

In JDK23, response headers are no longer always immediately sent. See
also https://bugs.openjdk.org/browse/JDK-8331847 This PR adds flush call
for the response body to make progress.

Resolves: #115145 Resolves: #115164
(cherry picked from commit 8c23fd7712)

* unmute
2024-10-25 13:40:35 +11:00
Joe Gallo
5bdeaa1f6d
Close exchanges in HttpClientTests (#115059) (#115458) 2024-10-24 11:36:47 +11:00
Oleksandr Kolomiiets
c3f8d87083
ignore_above default to 8191 for logsdb (#113442) (#115451)
In LogsDB we would like to use a default value of `8191` for the index-level setting
`index.mapping.ignore_above`. The value for `ignore_above` is the _character count_,
but Lucene counts bytes. Here we set the limit to `32766 / 4 = 8191` since UTF-8
characters may occupy at most 4 bytes.

(cherry picked from commit 521e4341d7)

# Conflicts:
#	server/src/main/java/org/elasticsearch/common/settings/Setting.java

Co-authored-by: Salvatore Campagna <93581129+salvatore-campagna@users.noreply.github.com>
2024-10-23 12:23:30 -07:00
Lee Hinman
1d09ec2544
[8.16] Reconcile differences between Stateful and Stateless dot-prefix validation (#114946) (#115058)
* Reconcile differences between Stateful and Stateless dot-prefix validation (#114946)

This commit makes the dot prefix deprecation match the existing changes to validation for the SLO
and SLA UIs.

Relates to #112571

(cherry picked from commit 5bf446ea2e)

* Update not to use getFirst

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-22 06:18:41 +11:00
Lorenzo Dematté
7a5b6cf798
Update APM Java Agent to support JDK 23 (#115194) (#115236) 2024-10-22 02:17:59 +11:00
Joe Gallo
3798bccfba
Fix IPinfo geolocation schema (#115147) (#115161) 2024-10-19 12:32:06 +11:00
Mary Gouseti
83d1dee64a
[8.16] Replace IntermittentLongGCDisruption with blocking cluster state updates (#115075) (#115085)
* Replace IntermittentLongGCDisruption with blocking cluster state updates (#115075)

In JDK 23 `Thread.resume` has been removed this means that we cannot use
`IntermittentLongGCDisruption` that depends on it. 

We simulate the master node disruption with a `CyclicBarrier` that
blocks cluster state updates.

Closes: https://github.com/elastic/elasticsearch/issues/115045

The backport will close:
https://github.com/elastic/elasticsearch/issues/112634

* Unmute LazyRolloverDuringDisruptionIT
2024-10-18 22:05:08 +11:00
Panagiotis Bailis
06fd883b25
[8.16] Adding deprecation warnings for rank and sub_searches (#114854) (#114949)
* Adding deprecation warnings for rank and sub_searches (#114854)

* remove updatev10 reference
2024-10-17 08:04:16 +11:00
David Turner
bdac01785a
Inline MockTransportService#getLocalDiscoNode() (#114883) (#114887)
This method just delegates to `getLocalNode()`, we may as well call the
more widely-used method with the shorter name directly.
2024-10-16 21:47:07 +11:00
Mary Gouseti
6de48b122f
[Failure store - selector syntax] Replace failureOptions with selector options internally. (#114812) (#114882)
**Introduction**

> In order to make adoption of failure stores simpler for all users, we
are introducing a new syntactical feature to index expression
resolution: The selector. > > Selectors, denoted with a :: followed by a
recognized suffix will allow users to specify which component of an
index abstraction they would like to operate on within an API call. In
this case, an index abstraction is a concrete index, data stream, or
alias; Any abstraction that can be resolved to a set of indices/shards.
We define a component of an index abstraction to be some searchable unit
of the index abstraction. > > To start, we will support two components:
data and failures. Concrete indices are their own data components, while
the data component for index aliases are all of the indices contained
therein. For data streams, the data component corresponds to their
backing indices. Data stream aliases mirror this, treating all backing
indices of the data streams they correspond to as their data component.
>  > The failure component is only supported by data streams and data
stream aliases. The failure component of these abstractions refer to the
data streams' failure stores. Indices and index aliases do not have a
failure component.

For more details and examples see
https://github.com/elastic/elasticsearch/pull/113144. All this work has
been cherry picked from there.

**Purpose of this PR**

This PR is replacing the `FailureStoreOptions` with the
`SelectorOptions`, there shouldn't be any perceivable change to the user
since we kept the query parameter "failure_store" for now. It will be
removed in the next PR which will introduce the parsing of the
expressions. 

_The current PR is just a refactoring and does not and should not change
any existing behaviour._
2024-10-16 20:27:25 +11:00
Joe Gallo
c3e7eed0eb
Download IPinfo ip location databases (#114847) (#114872)
Backport of #114847
2024-10-16 13:34:15 +11:00
Oleksandr Kolomiiets
17022fdefc
[8.x] Allow stored source in logsdb and tsdb (#114454) (#114648)
* Allow stored source in logsdb and tsdb (#114454)

(cherry picked from commit a62228a744)

# Conflicts:
#	modules/aggregations/build.gradle
#	modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/logsdb/LogsIndexModeCustomSettingsIT.java
#	rest-api-spec/build.gradle

* Fix tests

* Fix tests

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-15 12:07:27 -07:00
Joe Gallo
45881c4c9f
Support IPinfo databases in the ip_location processor (#114735) (#114776) 2024-10-15 22:20:01 +11:00
David Turner
98209e44de
Simplify XContent output of epoch times (#114491) (#114736)
Today the overloads of `XContentBuilder#timeField` do two rather
different things: one formats an object as a `String` representation of
a time (where the object is either an unambiguous time object or else a
`long`) and the other formats only a `long` as one or two fields
depending on the `?human` flag.

This is trappy in a number of ways:

- `long` means an absolute (epoch) time, but sometimes folks will
  mistakenly use this for time intervals too.

- `long` means only milliseconds, there is no facility to specify a
  different unit.

- the dependence on the `?human` flag in exactly one of the overloads is
  kinda weird.

This commit removes the confusion by dropping support for considering a
`Long` as a valid representation of a time at all, and instead requiring
callers to either convert it into a proper time object or else call a
method that is explicitly expecting an epoch time in milliseconds.
2024-10-15 03:46:31 +11:00
Martijn van Groningen
8b6ae3cdba
Update IndexSettingProvider#getAdditionalIndexSettings() signature (#114150) (#114724)
With logsdb another index mode is available, the isTimeSeries parameter is limiting. Instead, we should just push down the index mode from template to index settings provider.

Follow up from #113451
Relates to #113583
2024-10-15 02:39:23 +11:00
Mary Gouseti
04bc70c84c
Introduce CRUD APIs for data stream options (#113945) (#114718)
In this PR we introduce two endpoint PUT and GET to manage the data
stream options and consequently the failure store configuration on the
data stream level. This means that we can manage the failure store of
existing data streams.

The APIs look like:

```
# Enable/disable 
PUT _data_stream/my-data-stream/_options
{
  "failure_store": {
    "enabled": true
  }
}

# Remove existing configuration
DELETE _data_stream/my-data-stream/_options

# Retrieve 
GET _data_stream/my-data-stream/_options
{
  "failure_store": {
    "enabled": true
  }
}
```

Future work:

- Document the new APIs
- Convert `DataStreamOptionsIT.java` to a yaml test.
2024-10-15 01:15:32 +11:00
Oleksandr Kolomiiets
006c274824
Remove cluster.logsdb.enabled from StackPlugin (#113616) (#114664)
After introducing #113505 we need to remove `cluster.logsdb.enabled` from
`StackPlugin` and `StackTemplateRegistry`.

(cherry picked from commit 487c5562aa)

Co-authored-by: Salvatore Campagna <93581129+salvatore-campagna@users.noreply.github.com>
2024-10-11 17:42:26 -07:00
Joe Gallo
47bf5b9e2f
Refactor IPinfoIpDataLookupsTests tests (and others) (#114667) (#114672) 2024-10-12 11:40:33 +11:00
Joe Gallo
25ffc1526a
Support IPinfo database configurations (#114548) (#114663) 2024-10-12 09:15:57 +11:00
Keith Massey
f61c9d0afc
Move tests out of geo ip processor tests (#114656) (#114666) 2024-10-12 09:15:12 +11:00
Patrick Doyle
15343e4ec0
Backport ChunkedXContentBuilder to 8.16.0 (#114659)
* Create a fluent builder to help implement ChunkedToXContent (#112389)

Rather than manually adding startObject/endObject, and having to line everything up manually, this handles the start/end for you.
A few implementations are converted already. In the long run, I would like this to replace ChunkedXContentHelper.

* Convert a few more implementations to ChunkedXContentBuilder (#113125)

Remove the complex methods from ChunkedXContentHelper

* Further conversions to ChunkedXContentBuilder (#114237)

---------

Co-authored-by: Simon Cooper <simon.cooper@elastic.co>
2024-10-12 07:54:35 +11:00
Mary Gouseti
feec6c7bfb
[Failure store - selector syntax] Refactor IndicesOptions builder (#114597) (#114622)
**Introduction**

> In order to make adoption of failure stores simpler for all users, we
are introducing a new syntactical feature to index expression
resolution: The selector. > > Selectors, denoted with a :: followed by a
recognized suffix will allow users to specify which component of an
index abstraction they would like to operate on within an API call. In
this case, an index abstraction is a concrete index, data stream, or
alias; Any abstraction that can be resolved to a set of indices/shards.
We define a component of an index abstraction to be some searchable unit
of the index abstraction. > > To start, we will support two components:
data and failures. Concrete indices are their own data components, while
the data component for index aliases are all of the indices contained
therein. For data streams, the data component corresponds to their
backing indices. Data stream aliases mirror this, treating all backing
indices of the data streams they correspond to as their data component.
>  > The failure component is only supported by data streams and data
stream aliases. The failure component of these abstractions refer to the
data streams' failure stores. Indices and index aliases do not have a
failure component.

For more details and examples see
https://github.com/elastic/elasticsearch/pull/113144. All this work has
been cherry picked from there.

**Purpose of this PR**

This PR is replacing the the indices options boolean constructor with
the builders. The goal is to give me and the reviewer a very narrow
scope change when we can ensure we did not make any mistakes during the
conversion. Also it will reduce a bit the change list in
https://github.com/elastic/elasticsearch/pull/113144/files.
2024-10-12 01:47:17 +11:00
Kostas Krikellas
14ba77f21d
[TEST] Add coverage for field caps and ES|QL to LogsDB QA testing (#114505) (#114562)
* Add coverage for field caps and ES|QL to LogsDB QA testing

* address comments

* address comments

* address comments

(cherry picked from commit 34da953571)
2024-10-11 17:14:08 +11:00
Keith Massey
3adce49fdb
Adding support for registered country fields for maxmind geoip databases (#114521) (#114543)
Co-authored-by: Joe Gallo <joegallo@gmail.com>
2024-10-11 10:41:24 +11:00
David Turner
b2792a9a78
Remove unnecessary test overrides (#114291) (#114316)
These test overrides were introduced so that we had somewhere to hang an
`@AwaitsFix` annotation, but now the tests are unmuted again there's no
need for the overrides.

Relates #108336
2024-10-11 08:44:06 +11:00
Joe Gallo
3b8e33768a
Verify Maxmind database types in the geoip processor (#114527) (#114532) 2024-10-11 08:24:24 +11:00
Mary Gouseti
5b3625d849
Clean up factory retention settings from elasticsearch (#114396) (#114485)
This removes the possibility for a plugin to provide factory retention settings. Factory retention settings have been deprecated and completely replaced by #111972.

Note: this feature is not in use. If someone wants to set global retention they can use the cluster settings as defined in #111972.
2024-10-10 20:57:58 +11:00
Joe Gallo
57f083e1ca
IPinfo privacy detection support (#114456) (#114462) 2024-10-10 11:28:55 +11:00
Pete Gillin
6ec7a3439d
Add a terminate ingest processor (#114157) (#114343)
This processor simply causes any remaining processors in the pipeline
to be skipped. It will normally be executed conditionally using the
`if` option. (If this pipeline is being called from another pipeline,
the calling pipeline is *not* terminated.)

For example, this:

```
POST /_ingest/pipeline/_simulate
{
  "pipeline":
  {
    "description": "Appends just 'before' to the steps field if the number field
 is present, or both 'before' and 'after' if not",
    "processors": [
      {
        "append": {
          "field": "steps",
          "value": "before"
        }
      },
      {
        "terminate": {
          "if": "ctx.error != null"
        }
      },
      {
        "append": {
          "field": "steps",
          "value": "after"
        }
      }
    ]
  },
  "docs": [
    {
      "_index": "index",
      "_id": "doc1",
      "_source": {
        "name": "okay",
        "steps": []
      }
    },
    {
      "_index": "index",
      "_id": "doc2",
      "_source": {
        "name": "bad",
        "error": "oh no",
        "steps": []
      }
    }
  ]
}
```

returns something like this:

```
{
  "docs": [
    {
      "doc": {
        "_index": "index",
        "_version": "-3",
        "_id": "doc1",
        "_source": {
          "name": "okay",
          "steps": [
            "before",
            "after"
          ]
        },
        "_ingest": {
          "timestamp": "2024-10-04T16:25:20.448881Z"
        }
      }
    },
    {
      "doc": {
        "_index": "index",
        "_version": "-3",
        "_id": "doc2",
        "_source": {
          "name": "bad",
          "error": "oh no",
          "steps": [
            "before"
          ]
        },
        "_ingest": {
          "timestamp": "2024-10-04T16:25:20.448932Z"
        }
      }
    }
  ]
}
```
2024-10-09 16:44:57 +01:00