Fixes https://github.com/elastic/elasticsearch/issues/122967
When the Driver reported status, if the "report at least every X time" report was triggered, it was re-adding the same iterations and cpuTime again, as it wasn't clearing it before the next iteration.
Now, there are separated variables for the last updated iterations and reported time.
The setting based paths could be either absolute or relative, and they
are always relative to the config dir. This commit renames the
path_setting to make it clear it is related to config, and removes the
relative variant.
`TransportFieldCapabilitiesAction.doExecuteForked` would resolve the
project twice:
- Once implicitly when resolving indices from cluster state
- Another time to resolve index blocks
This changes this method to resolve `ProjectState` once and use that
instance for both index resolution and block checking
We already disable inter-segment concurrency in SearchSourceBuilder whenever
the top-level sort provided is not _score. We shoudl apply the same rules
in top_hits. We recenly stumbled upon non deterministic behaviour caused by
script sorting defined within top hits. That is to be expected given that
script sorting does not support search concurrency.
The sort script can be replaced with a runtime field, either defined in the
mapping or in the search request, which does support concurrency and guarantees
predictable behaviour.
* [IDEA] Enable Gradle Configuration Cache for Gradle Runner
This should speedup repetitives usages of the Gradle Runner for the majority of test executions
We added a flag to disable it explicitly if it does not work for certain scenarios
This test was muted, got fixed, and then was muted again but the issue
wasn't reopened (by accident it seems). Since that was 4 years ago, I'm
going to unmute this test and if it's still an issue, the new test
automation will open a new issue for it using the current muting
mechanism.
Relates #70595
SSL file utils currently only handle security manager access control
exceptions around file read checks. This PR extends these to support
entitlement checks as well.
There is no easy way to unit test this since we can't run unit tests
with entitlements enabled (for now). The PR includes a REST test
instead.
Relates: https://github.com/elastic/elasticsearch/issues/121960
When IndicesService is closed, the pending deletion may still be in
progress due to indices removed before IndicesService gets closed. If
the deletion stucks for some reason, it can stall the node shutdown.
This PR aborts the pending deletion more promptly by not retry after
IndicesService is stopped.
Resolves: #121717Resolves: #121716Resolves: #122119
Bit of a random find. Looks like we're effectively spending something
like ~0.5% of the total CPU time on resolving virtual calls for these
methods. Inlining `IOUtils` reduces their size quite a bit, removes
dead-code for rethrowing `IOException` that is never actually thrown
and hopefully as a result improve compilation a little here.
Fixes https://github.com/elastic/elasticsearch/issues/123430
There were 2 problems here:
- We were filling a static field (used to auto-cast string literals) within a constructor, which is also called in multiple places
- The field was only filled with non-snapshot functions, so snapshot function auto-casting wasn't possible
Fixed both bugs by making the field non-static instead, and a fix to use the snapshot registry (if available) in the string casting rule.
This change adds a unit test to demonstrate a specific
behavior of the AWS SDKv1, which closes the InputStream
used to upload a blob only after the HTTP request has
been sent (this is to accomodate for retries). The SDK
then swallows any exception thrown when closing the
InputStream which has the effect to hide any potential
CorruptIndexException that could have been detected
at that time.
Relates ES-10931
There is no guarantee that a project has non-null persistent tasks [0].
Null check is already done in most places. This PR adds it in a few more
places.
[0] Since health-node is now a cluster-scoped persistent task, it has
become more likely for the project-scoped tasks to be null.
Relates: #123262
When #119968 was merged into multi-project we introduced a regression by
inserting a call to `.getProject()` within the `RoutingNodes` class that
was supposed to be multi-project-aware.
This commit replaces those calls with `.indexMetadata` lookups
This commit reverts the changes to
docs/internal/DistributedArchitectureGuide.md
These changes need to be redone in order to update the code links
so that they point to a more recent version that includes the
`Metadata.ClusterCustom` / `Metadata.ProjectCustom` split
We also need to incorporate documentation updates to reflect the
changes to PersistentTasks.
This adds an exclusive parameter for FilesEntitlement where a path can be made exclusive for a certain
module. Should two modules attempt to both specify the same path as exclusive an exception is
thrown.
We're catching MP exceptions when applying cluster state listeners to
avoid noise in the logs, but we shouldn't forget to remove this `catch`
block at some point in the future.
These methods will be removed at some point in the future. By marking
them as deprecated, it'll be easier to spot that some code is using
these methods. Additionally, this will hopefully prevent people from
using these temporary methods.