Commit graph

1388 commits

Author SHA1 Message Date
Chris Hegarty
6b62c5129d
Replace use of reflection with MemorySegmentAccessInput (#109061)
This commit replaces the use of reflection with the newly added MemorySegmentAccessInput.
2024-05-27 17:49:49 +01:00
Rene Groeschke
2704d3a8d1
Remove cross project support in TestFixturesPlugin (#109077)
- One step closer to configuration cache support
- Crossproject support has been replaced by using testcontainer based fixtures
2024-05-27 17:59:14 +02:00
elasticsearchmachine
7bd291d726 Merge remote-tracking branch 'origin/main' into lucene_snapshot 2024-05-21 10:01:52 +00:00
Ryan Ernst
9e6fe11d19
Update ASM to 9.7 for plugin scanner (#108822)
This commit updates the ASM library in order to support class files
written with Java 23.

closes #108776
2024-05-20 11:56:23 -04:00
elasticsearchmachine
0ce5dadc6b Merge remote-tracking branch 'origin/main' into lucene_snapshot 2024-05-15 10:02:23 +00:00
Ryan Ernst
db70623442
Fix G1 JDK bug workaround (#108641)
The workaround requires to JDK args, but SystemJvmOptions actually
operates on individual JDK args. This commit adjusts SystemJvmOptions to
allow adding sets of jdk args together.
2024-05-14 19:42:35 -04:00
Ryan Ernst
b2bc951ac5
Workaround G1 bug for JDK 22 and 22.0.1 (#108571)
See https://bugs.openjdk.org/browse/JDK-8329528. The applied workaround
was suggested on the linked issue, and was tested and confirmed to avoid
the G1 bug.
2024-05-14 06:17:14 -07:00
elasticsearchmachine
46a9663957 Merge remote-tracking branch 'origin/main' into lucene_snapshot 2024-05-14 10:01:36 +00:00
Lorenzo Dematté
89d666bf90
Adding override for lintian false positive on libvec.so (#108521) 2024-05-13 19:22:12 +02:00
elasticsearchmachine
1d9cbbcded Merge remote-tracking branch 'origin/main' into lucene_snapshot 2024-05-08 10:01:34 +00:00
Moritz Mack
4c263e2ab4
CLI launcher / terminal improvements (#106470)
This removes getWriter() and getErrorWriter() from Terminal in order to prepare for using log4j in server-cli.
Additionally, ensure IO failures on the pump thread are handled once completed (closed) and
catch throwables in Command#main to print them (formatted) via Terminal.
2024-05-07 16:09:52 +02:00
elasticsearchmachine
6f46ee51c8 Merge remote-tracking branch 'origin/main' into lucene_snapshot 2024-05-03 10:01:31 +00:00
Jake Landis
6d20cef931
Bump Tika dependencies to 2.9.2 (#108144)
This commit bumps Tika to 2.9.2 and manually bumps the transitive versions 
to match 2.9.2's parent POM. This commit also centralizes the dependency 
versions so that you only need to look at 1 list to see the full set of dependencies 
to manually check.
2024-05-02 10:19:31 -05:00
elasticsearchmachine
e42f38c5c7 Merge remote-tracking branch 'origin/main' into lucene_snapshot 2024-05-02 10:01:20 +00:00
Ryan Ernst
a6e93c8fc6
Minor cleanups to auto heap (#107961)
Just a couple minor things: expose constants to subclass of auto heap
and removed unused test method
2024-05-01 18:54:52 -07:00
Chris Hegarty
1e233a993c
Enable native access for Lucene madvise 2024-04-29 11:35:32 +01:00
Ryan Ernst
d7e524fcf9
Make auto heap configuration configurable in server cli subclasses (#107919)
This commit makes auto heap configuration extendible so that serverless
can tweak the configuration based on project settings.
2024-04-26 08:08:24 -07:00
Ryan Ernst
7402f93839
Expose server process to server cli subclasses (#107729)
This commit gives protected access to subclasses of ServerCli (ie for
tests or serverless).
2024-04-23 17:17:34 -07:00
Chris Hegarty
6b52d7837b
Add an optimised int8 vector distance function for aarch64. (#106133)
This commit adds an optimised int8 vector distance implementation for aarch64. Additional platforms like, say, x64, will be added as a follow-up.

The vector distance implementation outperforms Lucene's Pamana Vector implementation for binary comparisons by approx 5x (depending on the number of dimensions). It does so by means of compiler intrinsics built into a separate native library and link by Panama's FFI. Comparisons are performed on off-heap mmap'ed vector data.

The implementation is currently only used during merging of scalar quantized segments, through a custom format ES814HnswScalarQuantizedVectorsFormat, but its usage will likely be expanded over time.

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
Co-authored-by: Lorenzo Dematté <lorenzo.dematte@elastic.co>
Co-authored-by: Mark Vieira <portugee@gmail.com>
Co-authored-by: Ryan Ernst <ryan@iernst.net>
2024-04-12 08:44:21 +01:00
Ryan Ernst
4114eea1a2
Allow force stopping server process (#107170)
This commit allows the cli access to sending SIGKILL to the underlying
jvm process.
2024-04-10 20:38:22 -04:00
Ryan Ernst
f5a7d25f06
Handle x86_64 os.arch for native libraries (#107289)
On some systems Java appears to return amd64 (even if not an amd
processor), but on others it returns x86_64. This commit handles the
latter case to correctly associate the arch with the appropriate
platform dir.
2024-04-10 14:51:52 -07:00
Nikolaj Volgushev
88306379ba
Increase KDF iteration count in KeyStoreWrapper (#107107)
This PR increases the KDF iteration count for the keystore password.

Additional context in ES-8063.
2024-04-08 05:28:12 -04:00
Ryan Ernst
e39fd58c5d
Fix jvm ergonomics tests (#106969)
closes #106554
2024-04-02 13:40:33 -07:00
David Turner
751742422a AwaitsFix for #106554 2024-03-20 14:22:38 +00:00
Henning Andersen
9315f8022d
Enhance search tier GC options (#106526)
For small nodes, we need a bit more wiggle room for new size
and concurrent GC threads in order to stay below real memory
circuit breaker limits on dedicated search nodes.

ES-8087
2024-03-20 13:20:54 +01:00
Ryan Ernst
405b88b882
Add zstd to native access (#105715)
This commit makes zstd compression available to Elasticsearch. The
library is pulled in through maven in jar files for each platform, then
bundled in a new platform directory under lib. Access to the zstd
compression/decompression is through NativeAccess.
2024-03-13 09:45:12 -07:00
Ryan Ernst
067aba96cd
Standardize build distribution internals on os/architecture (#105842)
The build handles platform specific code which may be for arm or x86.
Yet there are multiple ways to describe 64bit x86, and the build
converts between the two in several places. This commit consolidates on
the x64 nomenclature in most places, except where necessary (eg ML still
uses x86_64).

relates #105715
2024-02-28 11:47:12 -05:00
Simon Cooper
b752169ee9
Use hamcrest regex matcher rather than our own (#104457)
The difference is that our matcher uses .find() to search for a regex match anywhere in the string, whereas the hamcrest one uses .matches() to check the whole string against the regex. This leads to more specific regex checks.

I've left our own one for YAML tests, as that way we don't need to mangle the regex to add .* either side, which might be confusing in test failures.
2024-02-22 16:15:36 +00:00
Ryan Ernst
6375e9f443
Add native access library (#105100)
Elasticsearch requires access to some native functions. Historically
this has been achieved with the JNA library. However, JNA is a
complicated, magical library, and has caused various problems booting
Elasticsearch over the years. The new Java Foreign Function and Memory
API allows access to call native functions directly from Java. It also
has the advantage of tight integration with hotspot which can improve
performance of these functions (though performance of Elasticsearch's
native calls has never been much of an issue since they are mostly at
boot time).

This commit adds a new native lib that is internal to Elasticsearch. It
is built to use the foreign function api starting with Java 21, and
continue using JNA with Java versions below that.

Only one function, checking whether Elasticsearch is running as root, is
migrated. Future changes will migrate other native functions.
2024-02-07 18:27:09 -05:00
Ryan Ernst
2a298a7acc
Add replay diagnostic dir to system jvm options (#103535)
When hotspot encounters an error, it will emite a log file which can be
used for reproducing the error. This file is dumped to /tmp by default.
This commit configures the replay file to be alongside the hs_err file.
2024-02-05 20:58:53 -08:00
Ryan Ernst
125c1c86af
Fix server cli to always pass through exit code (#104943)
In certain circumstances if Elasticsearch encounters an error while
starting up, the server cli may exit with no error. This commit fixes
the cli to always check and wait on the Elasticsearch process and exit
with the same exit code.

relates #104055
2024-01-31 12:28:09 -05:00
Moritz Mack
dbf59c5414
Update/Cleanup references to old tracing.apm.* legacy settings in favor of the telemetry.* settings (#104917) 2024-01-31 09:20:05 +01:00
Moritz Mack
35cc9e1159
New APM settings using telemetry. prefix deprecate ambiguous tracing.apm. settings. (#104376)
Telemetry / APM settings are renamed from "tracing.apm.{name}" to "telemetry.tracing.{name}" for tracing related settings. General APM settings are renamed to "telemetry.{name}". The old legacy settings are kept for now and applied as fallback.
2024-01-30 09:34:03 +01:00
Rene Groeschke
077d8be599
Fix typo in BuildParams.isCi() usage (#104812) 2024-01-26 09:24:12 -05:00
Rene Groeschke
ab8ee60bba
Fix SamlAuthenticationIT flakyness (#103867) 2024-01-24 13:44:31 -05:00
Stuart Tettemer
3493e425ac
Metrics: Agent settings prefix telemetry.agent preferred over tracing.apm.agent (#104345)
Prefer the telemetry.agent prefix for APM agent settings.

Add a fallback prefix to Affix settings to migrating between an old prefix
and a new prefix.
2024-01-22 12:53:36 -06:00
Moritz Mack
00ca64bcf2
Use allow-list for APM agent settings and consolidate defaults in APMJvmOptions (#104141)
Prevent invalid and miss-configuration of APM agent using an explicit allow-list of setting keys.
Additionally, configuration defaults of APMAgentSettings are consolidated in APMJvmOptions to keep defaults in a single location.
(ES-6916)
2024-01-12 10:30:04 +01:00
Ryan Ernst
2f5247117e
Upgrade ASM to 9.6 for Java 22 support (#104085)
This commit upgrades the version of asm used by the build and plugins in
order to support Java 22 version format.

closes #104065 relates #103963
2024-01-08 15:03:40 -05:00
Chris Hegarty
3f0a3dce66
Upgrade to Lucene 9.9.1 (#103387)
This commit upgrades to Lucene 9.9.1.

With the upgrade to 9.9.1 we can now remove the compiler excludes added by #103112.
2023-12-19 09:27:19 +00:00
Armin Braun
49f1b5b787
Make sure to close XContentParser in more spots (#103504)
We're leaking quite a few of these parsers. That doesn't seem to be much
of a problem but results in some memory inefficiencies in Jackson here
and there. This PR bulk fixes a bunch of instances that I could easily
automatically fix. I'll open a follow-up for closing the parser on the
document parsing context which also suffers from this but is non-trivial
to fix.
2023-12-19 10:26:06 +01:00
Lorenzo Dematté
0e5f485058
ServerProcess refactoring (separate options construction from ServerProcess start) (#102973)
* Refactoring: move command line and environment build to a separate class
* Refactoring: adding a builder
* Moving tmp dir setup and JVM option parsing outside of builder
2023-12-14 07:37:50 +01:00
Chris Hegarty
b510e59c67
Add JIT compiler excludes for computeCommonPrefixLengthAndBuildHistogram (#103112)
This commit adds a temporary JIT compile command that excludes the compilation of a couple of Lucene methods which, if compiled, crash the JVM.
2023-12-07 16:02:53 +00:00
Jon
c0bfab9338
Update IronBank docker image base to ubi:9.3 (#102721) 2023-12-06 10:18:47 -08:00
Lorenzo Dematté
c54ce68723
Switch InstallPluginActionTests to non-blocking SecureRandom seed generator (#102893)
* Force urandom on Linux
* Unmute test
2023-12-04 18:54:38 +01:00
Jon
6787765c37
Update IronBank BASE_IMAGE with ironbank prefix (#102720)
This supports local testing.  It should not be included in
hardening_manifest.yml, which injects the scope at runtime.
2023-11-30 13:47:33 -08:00
Rene Groeschke
98b9bd547a
Mute tests (#102785) 2023-11-30 13:16:35 +01:00
Lorenzo Dematté
e86f0f78ab
Adding extension point in ServerCli to add processing after server process exited (#102475) 2023-11-28 09:47:05 +01:00
Armin Braun
1b84ea7421
Delete all unused private methods (#98111)
Pretty straight forward dead-code cleanup I think. Just delete all
private methods or methods in private classes that aren't used.
2023-11-25 22:21:59 +01:00
Jake Landis
17a46a6e9f
upgrade bouncy castle jars (#100923)
This commit upgrades the Bouncy Castle jars. Bouncy Castle is used for 
some internal build concners as well as a comnand line application. 
Most notably Bouncy Castle is also used as the FIPs certified JCE/JSEE provider 
we use to test our ability to use a FIPs compliant crypto provider. 

The following changes here are a result of the upgraded Bouncy Castle jars:
* TLSv1.3 is now supported when running in FIPs mode 
* RSA PKCS#1 v1.5 is no longer allowed in FIPS mode
* Triple DES (3DES) is no longer allowed in FIPS mode
* Minor updates the security manager configuration used to test FIPs (to read permissions from the security provider)
* Minor adjustments to tests to accommodate the above changes. 
* Minor adjustments to the gradle build to accommodate new dependencies 

Note - update to the documentation will come in a later commit.
2023-11-21 11:14:41 -06:00
Mark Vieira
5d379626df
Expose historical feature metadata to rest tests (#102110)
This introduces a new getHistoricalFeatures() method on ESRestTestCase
which returns a map of historical feature version mappings loaded from
FeatureSpecification implementations from any plugins/modules in use
by the current test suite. The mappings are generated by a new Gradle
task at build time, and then injected into the test runtime as a
System property.
2023-11-14 10:38:33 -08:00