Commit graph

292 commits

Author SHA1 Message Date
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
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
Rene Groeschke
68337ff66e
[Gradle] Update shadow plugin (#116826) (#116877)
- The shadow plugin has changed ownership and plugin id.
- Make some formatting of poms more reproducible

(cherry picked from commit def490ef85)
2024-11-16 15:06:35 +01:00
Mark Vieira
0279c0a909
Add AGPLv3 as a supported license 2024-09-13 14:30:33 -07: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
David Turner
5662f988b2
Remove trappy timeouts in snapshot APIs (#109828)
Wholesale fix of every `TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT` in
`o.e.snapshots` and `o.e.repositories`, just pulling them up to the REST
layer (where they become API params), the test suite (where they become
`TEST_REQUEST_TIMEOUT`), or some other place where an explicit value is
available.

Relates #107984
2024-06-21 07:11:12 +10:00
Rene Groeschke
09583d99b1
Do not run :plugins:repository-hdfs:test on windows (#106765)
before refactoring the hdfs test fixture setup this was implicitly
achieved by disabling test task for docker agent not available on
windows.
2024-03-27 03:11:25 -04:00
Rene Groeschke
ceb2701719
Ignore repository-hdfs integ tests in fips mode (#106762)
Fixes https://github.com/elastic/elasticsearch/issues/106757
2024-03-26 10:31:38 -04:00
Rene Groeschke
b39b3731a7
Port krb5kdc to test container and rework hdfs handling (#106228)
This ports our krb5kdc test fixture to test container and reworks hdfs handling to also be based on test containers.
The yaml rest tests that are using hdfs required introducing variable substitution in yamlresttestparser handling.
2024-03-26 08:39:39 +01:00
Armin Braun
7a63a666e2
Dry up test code that extracts TotalHits from SearchResponse (#103269)
We have the pattern of getting a response only for its `TotalHits` in a couple of spots,
some of them still leaking the `SearchResponse`.
This PR dries up those that I could quickly identify to use the new utilty method to simplify this pattern
or just moves the code to `assertHitCount` where possible.
2023-12-11 18:25:22 +01:00
Yang Wang
b9c29807ec
Extract repositories metrics into its own class (#103034)
This PR is a follow up of
https://github.com/elastic/elasticsearch/pull/102505#discussion_r1402957598
that move the repositories metrics management into its own class which
is then passed around instead of relying on the raw meterRegistry and
string metric names.
2023-12-07 18:26:17 -05:00
Rene Groeschke
ab0bb4889a
Fix :plugins:repository-hdfs:forbiddenApisJavaRestTest (#102983)
Reworking forbiddenApis check to use gradle worker api exposed a bug in
how we resolve krb5kdc keytab information. This fixes the depenendency to krb5kdc keytab configuration and
its builtBy task.

This also changes the usage of krb5kdc keytab files to be passed directly to task classpath as
they are only required at runtime and directly having them as part of javaRestTestRuntimeOnly would mean precommit
requires krb5kdc compose up which we definitely not want
2023-12-06 08:33:27 +01:00
David Turner
824d06c8cf
Use random purpose in blob store repository tests (#102789)
Today many blob store repository tests specify that the operations they
perform have purpose `OperationPurpose#SNAPSHOT`, but most of these
tests do not care about the purpose of these operations. This commit
switches them to using a random purpose to highlight that the purpose is
unimportant to the test.
2023-11-29 20:21:07 -08:00
Armin Braun
cdc83ad29b
Add shorthand for prepareIndex to test infrastructure (#101187)
Same as #101175, shorten `client().prepareIndex(index)` and
`client().prepareIndex().setIndex(index)` via a test utility.
Saves lots of code now and sets up some follow-up simplifcations.
2023-11-23 15:47:36 +01:00
Armin Braun
a9c286b25c
Collapse verbose .execute().actionGet() calls in tests (#102502)
Cleaning this up a little even though it's still quite horrible.
`.get()` in this API actually means `actionGet()` so to speak.
I think a good first step to cleaning this up is to at least reduce
the duplication though and save 1k lines.
2023-11-23 10:10:10 +01:00
Mark Vieira
ee1467d4ff
Improve test avoidance (#101081) 2023-10-26 12:16:06 -07: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
Yang Wang
5628392fa5
Differentiate stats for the same blobstore operation with purposes (#99615)
Today blobstore stats are collected against each HTTP operation, e.g.
Get, List. This is not granular enough because the same HTTP operration
can be performed for different purposes, e.g. cluster state, indices or
translog. This PR adds a new Purpose enum to provide further breakdown
for the same HTTP operation. 

Relates: ES-6800
2023-10-02 06:37:08 -04:00
Francisco Fernández Castaño
f6a2b5c9ef
Add bulk delete method to BlobStore interface and implementations (#98948) 2023-08-29 12:25:03 +02:00
Piotr Stankowski
a462deaccf
HDFS plugin: add replication_factor param (#94132)
Allows users of the HDFS repository plugin to configure the replication factor for files created by the repository implementation at repository creation time.

---------

Co-authored-by: James Baiera <james.baiera@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-08-03 14:13:45 -04:00
Armin Braun
dd7d381922
Dry up getting cluster admin client in tests (#96952)
Drying this up further and adding the same short-cut for single node
tests. Dealing with most of the spots that I could grab via automatic
refactorings.
2023-06-22 14:27:23 +02:00
David Turner
350beea181
Arbitrary bytes in blob store register (#96019)
Today the blob store register supports recording only a `long`,
represented as an 8-byte blob. We need to store a little more data in
the register, so this commit generalises things to work with a
`BytesReference` directly.
2023-05-16 06:16:21 -04:00
Przemyslaw Gomulka
257d633f2d
Add slf4j-nop in order to prevent startup warnings (#95459)
currently when Elasticsearch starts up there are warnings on the console complaining about SLF4J providers not found.
this is emitted twice
1 - when repository-azure module is loaded
2 - when xpack-security (depending on transport-netty) module is loaded 

This commits adds a slf4j-nop to fix that warning

related to #93714
and #93878
2023-05-05 09:38:34 +02:00
Rory Hunter
fe1083f6c5
Upgrade spotless plugin to 6.17.0 (#94994)
Fixes #82794. Upgrade the spotless plugin, which addresses the issue
around formatting `instanceof` expressions. Formatting of statements
including lambdas seems to have improved too.
2023-04-04 10:03:32 +01:00
Rene Groeschke
e735455431
Provide hints to Gradle Task.onlyIf declarations (#94953)
* Update gradle enterprise plugin to show skip reasons in build scans
* Unify OS specific handling in build logic
2023-03-31 23:57:55 +02:00
David Turner
95daf492fc
Async blob-store compare-and-exchange API (#94092)
Further work towards the S3 compare-and-exchange implementation showed
that we would like this API to permit async operations. This commit
moves to an async API.

Also, this change made it fairly awkward to use an exception to deliver
to the caller the indication that the current value could not be read,
so this commit adjusts things to use `OptionalLong` throughout as
suggested in the discussion on #93955.
2023-02-27 08:41:34 +00:00
Armin Braun
a6f63df111
Introduce BlobStoreRepository CAS Mechanism (#93825)
Only for testing purposes through the `FsRepository` for now and rather simple,
but should get the job done and technically be correct for a compliant NFS implementation.

Co-authored-by: David Turner <david.turner@elastic.co>
2023-02-16 14:26:12 +00:00
Joe Gallo
582f1be95e
Update log4j2 LICENSE and NOTICE files (#93611) 2023-02-09 08:53:43 -05:00
Armin Braun
f2760c6e18
Nicer buffer handling (#93491)
Some optimisations that I found when reusing searchable snapshot code elsewhere:
* Add an efficient input stream -> byte buffer path that avoids allocations + copies for heap buffers, this is non-trivial in its effects IMO
  * Also at least avoid allocations and use existing thread-local buffer when doing input stream -> direct bb
  * move `readFully` to lower level streams class to enable this
* Use same thread local direct byte buffer for frozen and caching index input instead of constantly allocating new heap buffers and writing those to disk inefficiently
2023-02-06 10:55:56 +01:00
Artem Prigoda
2bc7398754
Use Strings.format instead of String.format(Locale.ROOT, ...) in tests (#92106)
Use local-independent `Strings.format` method instead of `String.format(Locale.ROOT, ...)`. 
Inline `ESTestCase.forbidden` calls with `Strings.format` for the consistency sake.
Add `Strings.format` alias in `common.Strings`
2023-01-03 19:28:27 +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
b8780d3b24
Align all usages of protobuf to be 3.21.9 (#92123)
Updating repository-hdfs, repository-gcs, and vector-tile to all use the same more recent protobuf.
2022-12-07 11:55:18 -06:00
Rene Groeschke
43a0377735
Update forbiddenapis to 3.4 (#90624)
Fix breaking changes to source validation after change in default jdk rule set
2022-10-06 16:52:06 +02:00
Simon Cooper
71455f87d5
Change plugins to use elasticsearch logging (#90227)
Change hdfs, gce, azure, ec2 plugins to use ES logging API
2022-09-29 10:59:31 +01:00
Armin Braun
97c533a562
Increase snaphot pool max size to 10 (#90282)
As discussed, we can be up to twice as fast without increasing CPU use
much on high latency blob stores so increasing the pool size to 10 here
to better utilize larger data nodes.
2022-09-23 17:06:57 +02:00
Yoann Rodière
841ac8e43a
Upgrade Apache Commons Logging to 1.2 (#85745)
* Upgrade to Apache Commons Logging 1.2 (#40305)
* Clarify that Apache HTTP/commons-* dependencies are not just for tests
2022-08-10 13:19:15 -04:00
Rene Groeschke
3909b5eaf9
Add verification metadata for dependencies (#88814)
Removing the custom dependency checksum functionality in favor of Gradle build-in dependency verification support. 

- Use sha256 in favor of sha1 as sha1 is not considered safe these days.

Closes https://github.com/elastic/elasticsearch/issues/69736
2022-08-04 09:51:16 +02:00
Chris Hegarty
453f12c72d
Upgrade to Log4J 2.18.0 (#88237) 2022-07-04 11:30:38 +01:00
Rene Groeschke
8ccae4da71
Setup elasticsearch dependency monitoring with Snyk for production code (#88036)
This adds the generation and upload logic of Gradle dependency graphs to snyk

We directly implemented a rest api based snyk plugin as:

the existing snyk gradle plugin delegates to the snyk command line tool the command line tool 
uses custom gradle logic by injecting a init file that is 

a) using deprecated build logic which we definitely want to avoid
b) uses gradle api we avoid like eager task creation.

Shipping this as a internal gradle plugin gives us the most flexibility as we only want to monitor 
production code for now we apply this plugin as part of the elasticsearch.build plugin, 
that usage has been for now the de-facto indicator if a project is considered a "production" project 
that ends up in our distribution or public maven repositories. This isnt yet ideal and we will revisit 
the distinction between production and non production code / projects in a separate effort.

As part of this effort we added the elasticsearch.build plugin to more projects that actually end up 
in the distribution. To unblock us on this we for now disabled a few check tasks that started failing by applying elasticsearch.build. 

Addresses  #87620
2022-06-29 13:29:14 +02:00
James Baiera
08d1c3e643
Update HDFS Repository to HDFS 3.3.3 (#88039)
This updates the HDFS repository plugin to use HDFS 3.3.3.
2022-06-28 11:02:54 -04:00
Armin Braun
0132541d60
Remove redundant BlobMetadata interface (#87705)
No need to have more than a simple record here at this point.
2022-06-18 20:41:32 +02:00
Mark Vieira
22aeebcd9f
Avoid starting test fixtures when resolving all external dependencies (#86357) 2022-05-11 07:59:34 -07:00
Ryan Ernst
0832232b99
Replace JavaVersion with Runtime.Version (#85361)
Since Java 9, the JDK has provided a means of parsing Java versions and
getting the current Java version. That class obviates the need for the
JavaVersion class of Elasticsearch. This commit removes the JavaVersion
class in favor of Runtime.Version.

Note that most of the changes here simply removed logic around
versioning because this change is intended only for the master branch,
where Java 17 is required.
2022-03-28 12:46:59 -07:00
Francisco Fernández Castaño
58d828ef08
Fix atomic writes in HDFS (#85210)
Ensure that the temporary file stream is closed
before renaming it to the final name.

This issue can impact HDFS repository operations,
as we use the atomic writes primitive to ensure
that writes to metadata files are atomic.
2022-03-23 11:59:09 +01:00
Rene Groeschke
e209a100b8
Cleanup repository-hdfs project (#84486)
- use separate sourceSets for different type of tests
- remove usage of RestBuildPlugin
- Make fixture dependencies gradle idiomatic

Co-authored-by: Rory Hunter <pugnascotia@users.noreply.github.com>
2022-03-02 09:55:05 +01: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
Mary Gouseti
4499050341
Use pattern matching for instanceof in plugins through qa, server/internalClusterTest (#82161) 2022-01-12 11:34:15 +01:00
Costin Leau
dddff27498
Upgrade to log4j 2.17.1 (#82111)
Upgrade to log4j 2.17.1
2021-12-28 23:33:07 +02:00
Chris Hegarty
a2bc4854b5
Fix split package org.elasticsearch.client (#82010)
Fixes split packages between server and the LLRC (and HLRC), by renaming
the server package to a more appropriate name that represents the fact
that is in an internal client. That is, rename server's
org.elasticsearch.client to org.elasticsearch.client.internal.
2021-12-22 17:43:04 +00:00
Chris Hegarty
1cc69f86fe
Upgrade to log4j 2.17.0 (#81902) 2021-12-18 17:40:36 +00:00