Commit graph

6178 commits

Author SHA1 Message Date
Keith Massey
874a1dc991
Limiting the number of nested pipelines that can be executed (#105428) (#105533)
Limiting the number of nested pipelines that can be executed within a single pipeline to 100
2024-02-15 07:50:27 -06:00
Keith Massey
7273e0243d
Adding executedPipelines to the IngestDocument copy constructor (#105427) (#105527) 2024-02-14 16:38:17 -06:00
Keith Massey
4d09f96f10
Improving the performance of the ingest simulate verbose API (#105265) (#105513)
This updates the simulate verbose API to run in O(N) (for number of pipelines)
time and memory like the simulate and ingest APIs rather than O(N^2).
2024-02-14 13:46:29 -06:00
Keith Massey
9b6cf272b6
Adding a custom exception for problems with the graph of pipelines to be applied to a document (#105196) (#105473)
This PR removes the need to parse the exception message to detect if a cycle has been detected
in the ingest pipelines to be run on a document.
2024-02-14 10:46:02 -06:00
Keith Massey
d57de7d01f
Adding some tests for many nested pipeline processors (#105291) (#105471) 2024-02-14 10:43:04 -06:00
Joe Gallo
c845bcda3c
[7.17] Ingest correctly handle upsert operations and drop processors together ( #104585) (#104887) 2024-01-30 12:24:09 -05:00
Jake Landis
2aeecfd084
[7.17] Manual backport of 103944 (#104016)
* Manual backport of 103944

* copy RegisteredDomainProcessorTests#testBasic from main
2024-01-08 11:31:01 -05:00
Slobodan Adamović
68e2508349
[7.17] [Test] Use larger client ports range for tests running on Windows (#103894) (#103914)
* [Test] Use larger client ports range for tests running on Windows (#103894)

This PR increases client's port ranges for tests which are executed
on Windows in order to avoid failures due to some port ranges being
excluded from use. The larger ports range (300) is chosen based on
the observation where a random consecutive range of 200 ports can
be excluded on Windows test workers.

Closes #102349

(cherry picked from commit bdf5c7fc38)

# Conflicts:
#	modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/transport/netty4/Netty4TransportMultiPortIntegrationIT.java
#	x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/transport/filter/IpFilteringIntegrationTests.java

* Fix compilation error
2024-01-04 10:00:23 -05:00
Ryan Ernst
1a99785036
Wrap painless explain error (#103151) (#103236)
In https://github.com/elastic/elasticsearch/pull/100872 Painless errors
were wrapped so as to avoid throwing Errors outside scripting. However,
one case was missed: PainlessExplainError which is used by
Debug.explain. This commit adds the explain error to those that painless
wraps.

closes #103018
2023-12-09 10:00:17 -05:00
Ryan Ernst
cd08b1e043
Improve painless error wrapping (#100872) (#102394)
* Improve painless error wrapping (#100872)

Painless sandboxes some errors from Java for which it can recover. These
errors are wrapped within a ScriptException. However, retaining the
error as a cause can be confusing when walking the error chain. This
commit wraps the error so that the real error type does not appear,
but maintains the same error message in xcontent serialized form.

* fix compile
2023-11-20 18:35:16 -05:00
Rene Groeschke
5afd06ae57
[7.17] Update Gradle Wrapper to 8.2 (#96686) (#97484)
* Update Gradle Wrapper to 8.2 (#96686)

- Convention usage has been deprecated and was fixed in our build files
- Fix test dependencies and deprecation
2023-09-27 08:46:44 +02:00
Joe Gallo
4bec04037b
Provide better error messages from kv processor (#99493) (#99919) 2023-09-26 11:30:09 -04:00
Rene Groeschke
bc733b98d8
Fix Painless method lookup over unknown super interfaces (#97062) (#99196)
In Java 21 List now extends SequencedCollection, instead of Collection
directly. When resolving methods Painless starts at the defined type,
and iterates up through super classes and interfaces. Unfortunately if a
superinterface was not known, as it is for SequencedCollection since it
is not in the allowed list of classes, method resolution would give up.
This commit adjusts the superinterface interation to continue traversing
until the method is found or no more superinterfaces are found.

fixes #97022

(cherry picked from commit 16b45575c3)

# Conflicts:
#	gradle.properties

Co-authored-by: Ryan Ernst <ryan@iernst.net>
2023-09-05 15:16:50 +02:00
Albert Zaharovits
82490eb237
Free up allocated buffers in Netty4HttpServerTransportTests (#99005) (#99037)
Closes #98869
2023-08-30 04:47:25 -04:00
Albert Zaharovits
0df52c8f67
Netty4 HTTP authn enhancements (#92220) (#96703)
This is a backport of multiple work items related to authentication enhancements for HTTP,
which were originally merged in the 8.8 - 8.9 releases.
Hence, the HTTP (only the netty4-based implementation (default), not the NIO one) authentication
implementation gets a throughput boost (especially for requests failing authn).

Relates to: ES-6188 #92220 #95112
2023-08-23 18:52:38 +03:00
Iraklis Psaroudakis
2a3d71b1e8
Upgrade Netty to 4.1.94.Final (#97114)
Backport of https://github.com/elastic/elasticsearch/pull/97112
2023-06-26 12:05:24 -04:00
Armin Braun
38b70f65fb
Upgrade Netty to 4.1.89 (#95559)
Upgrading 7.17.x to the version we've been using in 8.x for a while to
resolve audit issues.
2023-04-28 10:26:15 +02:00
David Turner
e9c21516ce Disable ESLoggingHandler by default (#94516)
Relates #93133
2023-03-23 12:48:34 +00:00
Mary Gouseti
21fe8829fc
Requiring the presence of the geoip fixture to run GeoIpDownloaderStats.testStats() (#91662) (#93459)
(cherry picked from commit ab17a13157)

authored-by: Keith Massey <keith.massey@elastic.co>
2023-02-02 16:41:40 +01:00
Mark Vieira
47c6fd34da
[7.17] Add JUnit rule based integration test cluster orchestration framework… (#92517)
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-22 17:48:07 -08:00
Rene Groeschke
62868b7abe
[7.17] Add verification metadata for dependencies (#88814) (#89105)
Backports the following commits to 7.17:
 - Add verification metadata for dependencies (#88814)
 - Add missing dependency verification checksums (#89139)
2022-08-08 12:30:59 +02:00
Keith Massey
ce27cd4c75
Expanding switch statement to cover all cases in ConvertProcessorTests (backport from 88772)(#88781) 2022-07-25 12:34:01 -05:00
Rene Groeschke
62294616df
[7.17] Rework testing conventions gradle plugin (#87213) (#88422)
Backports the following commits to 7.17:
 - Rework testing conventions gradle plugin (#87213)
2022-07-12 10:58:40 +02:00
Martijn van Groningen
8197cae343
[7.17] Don't ignore pipeline for upserts in bulk api (#87719) (#88053)
Don't ignore pipelines defined in bulk item for updates with upsert in bulk api.

Closes #87131
2022-06-27 12:53:05 +02:00
Nikola Grcevski
8d61b4f7dd
Backport of #87933 (#87979) 2022-06-23 12:33:14 -04:00
Mark Vieira
455153e73f
Use Azul Zulu JDK8 distribution instead of Adoptium/OpenJDK on MacOS with Apple Silicon (#87733) (#87935)
# Conflicts:
#	x-pack/qa/repository-old-versions/build.gradle

Co-authored-by: Amey Kulkarni <ameykulkarni@live.in>
2022-06-22 18:03:03 -04:00
Stuart Tettemer
b9a9134c05
Script: Load Whitelists as Resource (#87539) (#87565)
Changes PainlessPlugin.class.getResourceAsStream to
PainlessPlugin.class.getResource to avoid leaking unclosed
input streams
2022-06-09 11:50:13 -04:00
Rene Groeschke
91537609b6
[7.17] Remove elasticsearch.rest-test gradle plugin (#85491) (#87025)
Backports the following commits to 7.17:
 - Remove elasticsearch.rest-test gradle plugin (#85491)
2022-05-23 13:58:00 +02:00
Martijn van Groningen
d934617181
Don't download geoip databases if geoip system index is blocked. (#86917)
Backporting #86842 to 7.17 branch.

For example in the case that the a cluster is running out of disk
space and indices reject writes.

This can otherwise load to unnecessary error logs being printed and
just add to more instability. Instead, the GeoIpDownloader should
just try to download the files the next it runs.
2022-05-19 11:32:25 +02:00
Rene Groeschke
4eba2fa2c5
[7.17] Apply precommit checks for non productive projects (#85533) (#86029)
Ensure projects with only yaml, java or cluster tests also apply precommit checks.
We only apply testingconventions now for projects with existing src test folder
as the TestingConventionsTask is incompatible with projects with no test sourceSet.
This is a prerequisite to port more projects away from using StandaloneRestTestPlugin
and RestTestPlugin in favor of yaml, java or cluster tests with dedicated sourceSets.

Also we fix deprecation warnings for forbiddenPattern and filePermissions tasks about
implicit non declared dependencies on resources tasks.
2022-04-21 09:05:49 +02:00
Mark Vieira
b0794630d1
[7.17] Bump minimum compiler version to Java 17 (#85935) 2022-04-18 10:11:37 -07:00
Przemyslaw Gomulka
d02c9a7f78
Prevent ThreadContext header leak when sending response backport(#68649) (#85865)
We need to stash thread context in DefaultRestChannel before we call
channel.sendResponse because when calling this method, our execution
might be delayed and the thread be reused for another task - like
sending another response.
And it would see thread context from the initial “delayed” work.

This commit also expands the assertions on the empty thread context
to make sure it does not contains response headers.

closes #68278
2022-04-13 12:30:52 +02:00
Yannick Welsch
9f5a8831c5
[7.17] Fix wildcard highlighting on match_only_text (#85500) (#85593)
Fixes a bug where match_only_text fields were ignored during highlighting when a field name with wildcard was specified.

Closes #85493
2022-04-01 10:14:42 +02:00
Przemyslaw Gomulka
194386e188
[7.17] Cleanup SystemIndexMigration tests (#84281) (#85259)
Backports the following commits to 8.0:

Cleanup SystemIndexMigration tests (#84281)
and
Fix randomness in SystemIndexMigrationIT #85224
2022-03-23 11:22:28 +01:00
Martijn van Groningen
eaeb20f328
CompoundProcessor should also catch exceptions when executing a processor (#84838)
Currently, CompoundProcessor does not catch Exception and
if a processor throws an error and a method higher in the
call stack doesn't catch the exception then pipeline execution
stalls and bulk requests may not complete.

Usually these exceptions are caught by IngestService#executePipelines(...) method,
but when a processor executes async (for example: enrich processor) and the thread
that executes enrich is no longer the original write thread then there is no logic
that deals with failing pipeline execution and cleaning resources up. This then leads
to memory leaks.

Closes #84781


Also change how 'pipeline doesn't exist' error is thrown in TrackingResultProcessor.

With the change to CompoundProcessor thrown exceptions are caught and delegated to handler.
SimulateExecutionService in verbose mode ignores exceptions delegated to its handler, since
it assumes that processorResultList contains the result (successful or not successful) of every
processor in the pipeline.

In case TrackingResultProcessor for PipelineProcessor couldn't find the mentioned pipeline then
it just throws an error without updating the processorResultList. This commit addresses that.
2022-03-16 15:39:57 +01:00
Mary Gouseti
76eb914616
Mark GeoIpDownloaderTask as completed after cancellation #84028 (#85014) (#85023)
Persistent task framework requires tasks to be marked either completed or failed after cancellation. This was missing in GeoIpDownloader.
2022-03-16 08:40:10 -04:00
Andrei Dan
846d803bbb
GeoIP update logging (#84494)
The only place we download the database (in the traditional pull from
the configured endpoint sense) is in the `GeoIpDownloader`. The
`DatabaseNodeService` is looking up the chunks of data we save in the
`.geoip_databases` index.

This updates the logging to be clear about who does what.
2022-03-14 14:18:11 +00:00
William Brafford
2d1a8c94ff
Bump timeout for feature migration in system index migration test (#84828) (#84893)
* Bump timeout on assertBusy loop
2022-03-10 17:54:23 -05:00
Nikola Grcevski
fb62112210
[7.17] Wait for green before checking index stats (#84646) (#84673)
Wait for green in FeatureMigrationIT before checking index stats
2022-03-07 10:14:32 -05:00
Gordon Brown
68251d46a0
[7.17] Register Feature migration persistent task state named XContent (#84192) (#84258)
In addition to the backport, this commit also adds SystemIndexMigrationTaskParams/State to writeableRegistry of transport client
This will backport the following commits from master to 7.17:

Register Feature migration persistent task state named XContent (#84192)
2022-02-23 13:09:55 +01:00
Rene Groeschke
ee79b04093
Replace deprecated api in artifact transforms (#84015) (#84023)
`ArtifactAttributes.ARTIFACT_FORMAT` has been deprecated in favor of
public available `ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE`
2022-02-21 10:29:56 +01:00
Gordon Brown
6a2cfe26d1
[7.17] Always re-run Feature migrations which have encountered errors (#83918) (#84137)
* Always re-run Feature migrations which have encountered errors (#83918)

This PR addressed the behavior described in #83917, in which Feature migrations
which have encountered errors are not re-run in some cases. As of this PR, Features
which have encountered errors during migration are treated the same as Features 
requiring migration.

This PR also adds a test which artificially replicates #83917.

* Adjust for method signature differences in this branch
2022-02-17 18:51:54 -05:00
Julie Tibshirani
2ccf3f10a3 Mute FeatureMigrationIT#testMigrateInternalManagedSystemIndex 2022-02-17 15:16:13 -08:00
Gordon Brown
c3f34f69a6
Correctly migrate system indices that are still using named types (#83817)
Prior to this PR, the system index migration facility did not use the
index type configured in the descriptor, instead always using `_doc`.

This PR adjusts the migration facility to use the index type specified
in the descriptor instead.

Note that this PR is only targeted at 7.17, as it is the only version impacted.
2022-02-17 09:57:20 -07:00
Ignacio Vera
6fb7e73204
[7.17] GeometryNormalizer should not fail if it cannot compute signed area (#84051) #84082 (#84083)
* GeometryNormalizer should not fail if it cannot compute signed area (#84051)

This commit removes the exception throwing and assumes that when the area is zero, the polygon has
the right orientation. The exception will be thrown at indexing time when the polygon is invalid .
# Conflicts:
#	server/src/test/java/org/elasticsearch/common/geo/GeometryIndexerTests.java
#	server/src/test/java/org/elasticsearch/common/geo/GeometryNormalizerTests.java

* spotless
2022-02-17 03:49:54 -05:00
Ryan Ernst
a5c3b350e7
Use latch to speedup multi feature migration test (#84007) (#84070)
The multi feature migration test works by having two system index
features that are to be upgraded. The reindexing of the system indices
of those features is done in sequence by the system index migrator, and
the test has an assertBusy that waits for all the migrations to
complete. Unfortunately assertBusy backs off exponentially, so it isn't
great for quickly resuming the test once the underlying assertion
becomes true, since the condition might change shortly after an
iteration, and then have to wait for a long backoff.

This commit adds a latch which will count down all the executions of the
test plugins, so that the assert busy will not be run until after all
the indexes have migrated.

closes #83953
2022-02-16 19:15:05 -05:00
James Baiera
92b3d0dfd6
[7.17] Update YAML Rest tests to check for product header on all responses (#83290) (#83996)
* Update YAML Rest tests to check for product header on all responses (#83290)

This PR fixes a number of misuses of ThreadContext, mostly because of stashing listeners 
without their accompanying contexts. The YAML Rest Test changes in the original PR were
not backported since they break BWC testing going further back into 7.x.
2022-02-16 13:22:46 -05:00
Przemko Robakowski
4ebc5e345f
Fix GeoIpDownloader startup during rolling upgrade (#84000) (#84031)
If rolling upgrade was used from version prior GeoIPv2 (<`7.14`) then
geoip downloader wouldn't be started so no new databases were
downloaded. This is especially troubling in `8.x` as we no longer
provide default databases inside ES so after upgrade no geoip enrichment
can take place until downloader is started with workaround (setting
`ingest.geoip.downloader.enabled` to `false` and `true` again). This is
because logic that was used to lower number of requests / cluster update
listeners at the startup was too optimistic about order of actions / who
can be elected master at what time.  This change fixes that and also
cleans up logs when there are some ignorable errors and adds debug
logging on start and stop of the task to ease up troubleshooting. It
also adds rolling upgrade test to make sure the fix works.
2022-02-16 09:17:26 -05:00
Rene Groeschke
4de3fb5eaf
Remove usage of deprecated Provider#forUseAtConfigurationTime (#83932) (#83947)
Remove gradle api usage that has been deprecated with Gradle 7.4
2022-02-15 16:45:24 +01:00
Dan Hermann
703c148008
Short circuit date patterns after first match (#83764) (#83873) 2022-02-15 08:37:51 -06:00