Commit Graph

2120 Commits

Author SHA1 Message Date
Andrei Dan 01ed7de99f
GA the data stream lifecycle (#98644)
This makes the data stream lifecycle generally available. This will allow
data streams to take advantage of a native simplified and resilient
lifecycle implementation.
2023-08-21 17:28:54 +01:00
Simon Cooper 0754bd8943
Unmute FeatureUpgradeIT test (#98576)
Test was fixed by #98574
2023-08-17 13:35:52 +01:00
Simon Cooper 547947d465
Specify correct current IndexVersion after 8.10 release (#98574)
The current IndexVersion wasn't bumped by the release automation as it should have been
2023-08-17 09:28:34 +01:00
Tim Vernum 0c35785d22
Mute FeatureUpgradeIT (#98563)
Relates: #98562
2023-08-17 03:16:37 -04:00
Tim Vernum 136a60c92a
Mute upgrades.FullClusterRestartIT.testClusterState (#98556)
Relates: #98555
2023-08-17 00:06:34 -04:00
William Brafford 874fbbc2f0
Add mappings version number to SystemIndexDescriptor (#97934)
This PR adds a mappings version number to system index descriptor, which is intended to replace the use of Version to signal changes in the mappings for the descriptor. This value is required for managed system indices.

Previously, most of the system index descriptors automatically incremented their mapping version with each release, which meant that the mappings would stay up-to-date with any additive changes. Now, developers will need to increment the mapping version whenever there's a change.

* Add MappingsVersion inner class to SystemIndexDescriptor
* Add mappings version to metadata in all system index mappings
* Rename version meta key ('system' -> 'managed')
* Update mappings for ML indices if required
* Trigger ML index mappings updates based on new index mappings version.

---------

Co-authored-by: Ed Savage <ed.savage@elastic.co>
2023-08-17 00:03:12 -04:00
Lorenzo Dematté 0ab932f418
Mute MultiVersionRepositoryAccessIT tests (#98440)
* Re-enable suppressed tests to run them through CI

* Change AwaitsFix notation to reflect the current tracking issue
2023-08-16 16:39:07 +02:00
Simon Cooper cbec47f541
Modify upgrade test version check to include 8.10 (#98536)
IndexVersion hasn't yet been separated from Version. So it's ok to modify this check to allow 8.10 releases to run the test.
2023-08-16 15:04:08 +01:00
Tim Vernum 50706f0f5e
Support path filtering in YAML test suite (#98430)
Some Rest Specs contain multiple paths, where some paths are
preferred and the others exist for historical reasons.

This commit makes 2 changes:

1. Tracks when a path is deprecated in the Rest Spec, so that metadata
   can be accessed in the Java model of the API
2. Adds filter (predicate) to the execution context to determine which
   paths should be considered as candidates within the test suite

Tests that extends from `ESClientYamlSuiteTestCase` can override
`createRestTestExecutionContext` and pass in a predicate that skips
deprecated paths (or any other criteria), provided that it does not
skip _all_ paths in an API.
2023-08-15 13:03:16 +10:00
Michael Peterson 6420924e31
Minor improvements for Cross-Cluster Search code (#98405)
Several minor structural and test improvements for cross-cluster search

These changes set the stage for a follow-on ticket to add _cluster/details to
cross-cluster searches with minimize_roundtrips = false. To help keep that
PR from being too large some of the simpler required changes and tests
are added in this PR.
2023-08-13 19:30:17 -04:00
Yang Wang d0f64941f0
Remove RCS 2.0 feature flag for beta release (#98307)
This PR removes the RCS 2.0 feature flag so that it is ready for beta
release.
2023-08-14 08:33:37 +10:00
Tim Vernum 6fa5c61cf2
Support operator users in LocalClusterSpec (#97340)
This adds a new parameter to LocalClusterSpecBuilder.user(..) to
indicate whether the user should be an operator or not.

Users added with the simplified user(username, password) method are
operators (and have the "_es_test_root" role).
2023-08-09 02:38:58 -04:00
Tim Vernum 3093c40b8b
Make RestController pluggable (#98187)
This commit changes the ActionModules to allow  the RestController to be
provided by an internal plugin.

It renames  `RestInterceptorActionPlugin` to `RestServerActionPlugin`
and adds a new `getRestController` method to it.

There may be multiple RestServerActionPlugins installed on a node, but
only 1 may provide a Rest Wrapper (getRestHandlerInterceptor) and only 1
may provide a RestController (getRestController).
2023-08-08 01:29:24 -04:00
David Turner 4458517a28
Fix testClosedIndexNoopRecovery (#98093)
This test only delays allocation for 120s which isn't necessarily enough
time for the node to come back, and yet it requires the shard to be
assigned back to the first node. This commit extends the timeout to make
sure the shard is reassigned as required, and tidies up a few other
aspects.

Closes #97896
2023-08-01 13:51:57 +01:00
Mary Gouseti 49ad2d5365
Add require data stream lifecycle feature flag (#98022) 2023-07-28 11:40:21 +03:00
Carlos Delgado 375991d974
Remove synonyms feature flag and related classes (#97962) 2023-07-26 18:13:06 +02:00
Przemyslaw Gomulka 3516cdfe47
Add Configuration to PatternLayout (#97679)
in 2.17.2 (patch release) log4j has made a refactoring that requires a Configuration to be manually
passed into the created PatternLayout
If the Configuration is not passed, the System Variable lookup will not work
This results in cluster.name field not being populated in logs if ESv7 layout was used on ESv8 cluster (cloud)

This commit creates a PatternLayout with a DefaultConfiguration (the same was used previous to the refactoring)
Also adds back tests that verifies ESv8 cluster with ESv7 logging config. We still have that situation in the cloud so it is better to have tests around this.

relates apache/logging-log4j2#1551
2023-07-26 12:32:37 +02:00
Ryan Ernst 3f8f7182be
Remove index version and transport version from main endpoint response (#97675)
The index and transport versions are low level details of how a node
behaves in a cluster. They were recently added to the main endpoint
response, but they are too low level and should be moved to another
endpoint TBD.

This commit removes those versions from the main endpoint response. Due
to the fact lucene version is now derived from index version, this
commit also adds an explicit lucene version member to the main response.
2023-07-18 06:36:46 -07:00
Ievgen Degtiarenko 32fb774976
Enable testSnapshotBasedRecovery (#97654)
Cancel shard allocation command is broken for initial desired balance versions
and might allocate shard on the node where it is not supposed to be. This
is fixed by https://github.com/elastic/elasticsearch/pull/93635. Disabling test
when upgrading from affected versions.
2023-07-13 16:27:58 +02:00
Carlos Delgado 2412adf0fa
Fix synonyms API analyzers reloading (#97621) 2023-07-13 14:28:28 +02:00
Pooya Salehi c9c2f76d79
Make EWMA alpha configurable in FixedExecutor (#97424)
For Stateless autoscaling, we'd need a different Alpha to track the task
execution time EWMA. This change makes the EWMA Alpha configurable  and
uses a different value for the Write executors.

Closes ES-6325
2023-07-10 06:05:04 -04:00
Simon Cooper 52a6820813
Migrate some full-cluster restart tests to use IndexVersion (#97368)
This infers the index version from the specified node version. Note that this will break when 8.10 is released, and BwC tests try to use 8.10 nodes. #97200 should be implemented before 8.10 is released to properly specify IndexVersion, without requiring inference.
2023-07-10 10:48:51 +01:00
Simon Cooper 572716f7cc
Add IndexVersion to MainResponse (#97386) 2023-07-07 11:27:54 +01:00
Mary Gouseti a432313ff3
Data stream lifecycle class names (#97381) 2023-07-05 12:28:32 +03:00
Simon Cooper 55cf37cedd
Migrate Snapshot repository version to IndexVersion (#97226) 2023-07-04 11:42:46 +01:00
Simon Cooper 602ccd8d60
Migrate IndexMetadata.getCreationVersion to IndexVersion (#97139) 2023-06-29 08:38:50 +01:00
Simon Cooper 5486667d73
Convert snapshot version to IndexVersion (#96857) 2023-06-28 16:04:19 +01:00
Simon Cooper f554a6ab2d
Remove the DiscoveryNode constructor that takes a Version (#97136) 2023-06-27 16:41:45 +01:00
Simon Cooper a873e26cf7
Convert IndexVersion.CURRENT to a method with a pluggable interface (#97132) 2023-06-27 14:47:32 +01:00
Armin Braun 1a34568a8b
Remove remaining redundant overrides (#97134)
Follow-up to #97130, removing all remaining redundant overrides outside
the server package.
2023-06-27 13:08:13 +02: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
Rene Groeschke 89a65b2c5a
Make ESRestTestCase client configuration more configurable in subclasses (#96987)
We want to be able to tweak client configuration in tests extending
ESRestTestCase. This makes that simpler by allowing overriding the
general client configuration.
2023-06-21 14:02:34 -04:00
David Turner 1a942317a4
Make cluster health API cancellable (#96551)
This API can be quite heavy in large clusters, and might spam the
`MANAGEMENT` threadpool queue with work for clients that have long-since
given up. This commit adds some basic cancellability checks to reduce
the problem.
2023-06-21 08:05:39 -04:00
Ryan Ernst 7d8aac3a3e
Implement custom JUL bridge (#96872)
The log4j JUL bridge turned out to have issues because it relied on java
beans. This commit implements a custom bridge between JUL and Log4j.

closes #94613
2023-06-20 09:48:25 -07:00
Przemyslaw Gomulka 31e20d9239
Revert "Add JUL bridge (#96683)" (#96832)
This reverts commit 2bdf1bc0d6.
2023-06-14 14:37:53 +02:00
Ryan Ernst 2bdf1bc0d6
Add JUL bridge (#96683)
This commit adds the Log4j JUL bridge so that messages using JUL are
more nicely converted to log4j messages. Currently these messages are
captured via the stdout logging stream. This commit also adds a log4j
filter to replace the logging stream filtering mechanism used to quiet
some Lucene log messages that may be confusing to users.

closes #94613
2023-06-13 19:31:05 -04:00
Ryan Ernst 164e97e2ca
Encapsulate TransportVersion.CURRENT (#96681)
This commit changes access to the latest TransportVersion constant to
use a static method instead of a public static field. By encapsulating
the field we will be able to (in a followup) lazily determine what the
latest is, outside of clinit.
2023-06-13 18:44:15 -04:00
Stuart Tettemer 2be97132fc
Disable ccs-rolling-upgrade-remote-cluster in fips, refs: #96134 (#96776) 2023-06-12 14:10:47 -05:00
Stuart Tettemer b3d7ed530a
Switch API test @AwaitsFix to broader issue
Let's close the CI issue and focus on the general issue, #90308
Fixes #89340
2023-06-08 12:12:07 -05:00
Simon Cooper ec6b7900a9
Migrate some uses of Version.luceneVersion() to IndexVersion (#96300)
Redirect some uses of `Version.luceneVersion` to use
`IndexVersion.luceneVersion` instead
2023-06-08 11:13:15 -04:00
Andrei Dan 614fa5d5cb Revert "Require DLM enabled in the mixed-cluster QA cluster (#96391)"
This reverts commit 4ca12c1849.
2023-06-07 10:54:11 +01:00
Ryan Ernst aaa45d32c6
Retry windows file deletes in packaging tests (#96630)
We continue to have CI failures for open files when trying to cleanup on
Windows. This commit tries to account for one of those cases, where the
out/err redirects are cleaned up, opting to retry once after a delay.
2023-06-06 16:50:55 -04:00
Michael Peterson 8b1cd47455
Support CCS minimize round trips in async search (#96012)
* Support CCS minimize round trips in async search

This commit makes the smallest set of changes to allow async-search based cross-cluster search
to work with the CCS minimize_round_trips feature without changing the internals/architecture of
the search action.

When ccsMinimizeRoundtrips is set to true on SubmitAsyncSearchRequest, the AsyncSearchTask on the
primary CCS coordinator sends a synchronous SearchRequest to all to clusters for a remote coordinator
to orchestrate and return the entire result set to the CCS coordinator as a single response.

This is the same functionality provided by synchronous CCS search using minimize_roundtrips.
Since this is an async search, it means that the async search coordinator has no visibility
into search progress on the remote clusters while they are running the search, thus losing one of
the key features of async search. However, this is a good first approach for improving overall search
latency for cross cluster searches that query a large number of shards on remote clusters, since
Kibana does not currently expose incremental progress of an async search to users.

Relates #73971
2023-06-01 10:34:16 -04:00
Carlos Delgado 39b7b5eb56
Synonym Mgmnt API: PUT request (#95895) 2023-05-31 10:48:56 +02:00
David Turner e5111e388a
Make list-tasks API cancellable (#96283)
In a busy cluster the list-tasks API may retain information about a very
large number of tasks while waiting for all nodes to respond. This
commit makes the API cancellable so that unnecessary partial results can
be released earlier.

Relates #96279, which implements the early-release functionality.
2023-05-30 11:45:34 +01:00
Andrei Dan 4ca12c1849
Require DLM enabled in the mixed-cluster QA cluster (#96391) 2023-05-30 08:53:04 +01:00
Pablo Alcantar Morales 354992ebd7
Make cluster info rest endpoint cancellable (#96327) 2023-05-25 10:55:08 +02:00
Simon Cooper 84a85901ac
Change Version.luceneVersion to a method (#96244) 2023-05-22 14:54:54 +01:00
Nhat Nguyen 7da55d00b4
Integrate CCS with new search_shards API (#95894)
This PR integrates CCS with the new search_shards API. With this change, 
we will be able to skip shards on the coordinator on remote clusters
using the timestamps stored in the cluster state.

Relates #94534
Closes #93730
2023-05-17 11:36:52 -07:00
Przemyslaw Gomulka dc03c47ada
Refactor RestMainAction into separate module (#95881)
we want to allow overriding info (GET /) api in serverless, therefore this commit moves the RestMainAction and is transport classes into a module that has a rest plugin

Main endpoint is often used in testing to verfiy that a cluster is ready, hence this commit also has to add a testing dependency on main to a lot of modules

relates #95422
2023-05-10 14:39:00 +02:00
Yang Wang 86f37160ae
Enforce API key type on authentication (#95908)
The PR adds enforcement for API key type at authentication time.
Concretely, new cross-cluster API keys (#95714) can only be used on the
dedicated remote cluster interface and the existing (rest) API key must
not be used for new remote cluster communication. To make cross-cluster
API keys actually usable after authentication, the PR also adds support
for resolving their roles.
2023-05-10 00:12:07 -04:00
Yang Wang ac9822be72
Add named privileges for CCR with new RCS model (#95651)
This PR adds new named cluster and index priviliges for CCR actions
required with the new RCS model. The new privileges are tightly scoped
so that it is no longer necessary to grant wider named privileges, e.g.
manage. Concretely, the following privileges are added: * cluster
privilege `cross_cluster_replication` * index privilege
`cross_cluster_replication` covers index actions required to be
performed with end users * index privilege
`cross_cluster_replication_internal` covers index actions performed by
the internal user

The intention of having two index privileges for CCR is that
`cross_cluster_replication` could be granted as part of `remote_indices`
for end-users on the QC (follower cluster). QC admins or users do not
have to care about `cross_cluster_replication_internal` which will be
automatically handled by FC (leader cluster) admins once the specialized
API key is in place.

The PR also renames `cross_cluster_access` to `cross_cluster_search`
which corresponds better to the new `cross_cluster_replication`.
2023-05-04 01:05:08 -04:00
Salvatore Campagna abba374b08
Fix skip version (#95616)
Indexing in TSDB changed in 8.2.0 so we need to skip mixed cluster
tests on versions before 8.2.0.
2023-05-03 09:51:05 +02:00
Armin Braun c41bda9e3a
Dry up remaining verbose index setting building in tests (#95652)
Lasts spots I could easily find via regex.
Follow-up to #95569
2023-04-28 11:18:07 +02:00
Armin Braun 4e69fa102f
Dry up more of index setting creation in tests (#95602)
Quick follow-up to #95569 of spots that I could automatically identify
and refactor, saving another 1.5k LoC in tests.
2023-04-27 17:11:48 +02:00
Albert Zaharovits 8a32956b1b
Mute tsdb mixed cluster rest IT(#95609)
Muting  test {p0=tsdb/140_routing_path/missing routing path field} and
test {p0=tsdb/140_routing_path/multi-value routing path field}

Relates #95382
2023-04-27 13:50:03 +03:00
Ievgen Degtiarenko c2c0ced9b1
Reset desired balance (#94525)
This introduces an endpoint to reset the desired balance.
It could be used if computed balance diverged from the actual one a lot 
to start a new computation from the current state.
2023-04-20 08:03:48 +02:00
Andrei Dan 22255ed7d0
Enable DLM feature for smoke tests (#95215) 2023-04-13 12:25:23 +01:00
Simon Cooper 9fa7612d2d
Use separate transportversion for percolator query serialization (#94517)
This changes the serialization format for queries - when the index version is >=8.8.0, it serializes the actual transport version used into the stream. For BwC with old query formats, it uses the mapped TransportVersion for the index version.

This can be modified later if needed to re-interpret the vint used to store TransportVersion to something else, allowing the format to be further modified if necessary.
2023-04-05 13:13:14 +01: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 4ef9965d47
Report transport message size per action (#94543)
Adds to the transport stats a histogram of transport message sizes for
each transport action.

Closes https://github.com/elastic/elasticsearch/issues/88151
2023-03-28 12:05:18 -04:00
Armin Braun 26f728fd42
Add shortcut for creating index with given shard+replica counts in internal cluster tests (#94739)
Just needed this a bunch today and figured I'd make a method for it and use it where it's an obviously safe refactor.
2023-03-24 17:31:51 +01:00
Yang Wang 5dc2541675
Use SecureSetting to store RCS remote access key (#93763)
The remote access key is a secret. As such it should be stored in the ES
keystore instead of a filtered setting in cluster state.
2023-03-22 22:08:44 -04:00
Nikolaj Volgushev 56b849d802
Rename remote cluster setting to `credentials` (#94560)
Renames the `cluster.remote.*.authorization` setting to
`cluster.remote.*.credentials` since the name is more precise and aligns
with the rest of the code base.
2023-03-22 05:16:30 -04:00
David Turner 6da721edda
Assert TaskTransportChannel completed once (#94598) 2023-03-21 13:56:45 -04:00
Slobodan Adamović ee723ada0a
Mute SnapshotBasedRecoveryIT testSnapshotBasedRecovery (#94584)
Relates to https://github.com/elastic/elasticsearch/issues/93271
2023-03-21 08:45:27 -04:00
Slobodan Adamović 6b8e953128
Mute MultiVersionRepositoryAccessIT tests (#94580)
`MultiVersionRepositoryAccessIT` tests are failing often and causing BWC
CI to fail.

Relates to: https://github.com/elastic/elasticsearch/issues/94459
2023-03-21 07:33:14 -04:00
Yang Wang e126dc7063
Add redacted cluster credentials to RemoteConnectionInfo response (#94527)
This PR adds a redacted cluster_credentials field to the
RemoteConnctionInfo API response to differenitate between basic and RCS
remote clusters. The new field is available only for RCS remote
clusters.
2023-03-20 21:58:42 -04:00
Ievgen Degtiarenko 21adad38a3
Add data tier to /_internal/desired-balance (#94496) 2023-03-20 10:44:55 +01:00
Nikolaj Volgushev 90f6af3bdc
Naming refactor to use cross cluster access consistently (#94424)
Rename refactor PR that uses `cross_cluster_access` in place of
`remote_access` wherever appropriate, since `cross_cluster_access` is a
more precise, clearer term. No functional changes, however I did make a
few tweaks around version handling.
2023-03-14 13:13:09 -04:00
Yang Wang 43a4e8859a
[Test] Increase timeout for RcsCcsCommonYamlTestSuiteIT (#94493)
The test suite has been recently expanded to including more YAML tests,
PIT and msearh (#93720), EQL (#94265) and SQL (#94416). The original 15
min timeout needs to be bumped a bit to accomodate the new tests. This
PR increases it for additional 5 minutes.

PS: It is possible that the corresponding CcsCommonYamlTestSuite also
needs to similar increase in timeout. This PR does not touch it because
we haven't observed similar timeout for it so far and also tests with
existing CCS model and security disabled run a bit faster. So it may not
be an issue yet.

Resolves: #94491
2023-03-13 15:10:30 -04:00
Yang Wang 4f196c23cd
[Test] Add SQL yaml tests to CCS common yaml test suite (#94416)
This PR adds support for CCS common YAML test suite to run SQL yaml
tests with both the existing and new remote cluster models.

Relates: #94265, #93720

PS: SQL does not send its own actions across clusters and relies only on
the generic search, field_caps actions. Hence it is automatically
supported without touching production code, i.e. changes are test only.
2023-03-11 06:54:57 -05:00
Yang Wang a96ffea12e
Ensure EQL works with RCS (#94265)
The PR allows EQL read action to work with new RCS. It also updates the
common CCS test suite to include existing EQL yaml tests.

Relates: https://github.com/elastic/elasticsearch/pull/93720
2023-03-08 16:51:13 -05:00
Yang Wang e48728571d
Add named privilege for RCS cross cluster access (#94384)
This PR adds a new named privilege to encapsulate system actions
required for cross cluster access.
2023-03-09 00:17:16 +11:00
William Brafford 8b6ce3465e
Reset feature states before deleting indices in EsRestTestCase (#94191)
* Call feature cleanup in ES Test Case
* Don't reset features in certain integration tests
* Cleanup and handle warnings
2023-03-07 10:53:48 -05:00
Ievgen Degtiarenko 90d017ae09
Add cluster_info to the GET /_internal/desired-balance endpoint output (#94272) 2023-03-06 13:57:55 +01:00
Keith Massey b18c036761
Updating assorted integration tests to use BulkProcessor2 instead of BulkProcessor (#94172)
In https://github.com/elastic/elasticsearch/pull/91238 we rewrote
BulkProcessor to avoid deadlock that had been seen in the
IlmHistoryStore. At some point we will remove BulkProcessor altogether.
This PR ports a couple of integration tests that were using BulkProcesor
over to BulkProcessor2.
2023-03-03 13:51:12 -05:00
Yang Wang 9d6c44311d
Support Sniff mode for RCS (#93893)
This PR adds sniff mode support for RCS. It's achieved by having
alternative handshake action and nodes action to return DiscoveryNode
with remote cluster server address instead of the main transport
address. The changes are only effective to the new model and how
existing remote cluster model works is fully maintained. REST tests are
updated to random between proxy and sniff mode.

An additional benefit of using the alternative handshake action is that
we can remove the special handling of handshake action on the FC side to
ensure all actions must be allowed by the remote access API key. This
will be addressed in a separate PR.
2023-02-28 04:32:08 -05:00
Simon Cooper 0d09580110
Add separate TransportVersion parameter to MockTransportService (#94105) 2023-02-27 09:24:22 +00:00
David Turner c0587289af
Improve master service batching queues (#92021)
Today the master's pending task queue is just the
`PriorityBlockingQueue<Runnable>` belonging to the underlying
`ThreadPoolExecutor`. The reasons for this date back a long way but it
doesn't really reflect the structure of the queue as it exists today. In
particular, we must keep track of batches independently of the queue
itself, and must do various bits of unchecked casting to process
multiple items of the same type at once.

This commit introduces an new queueing mechanism, independent of the
executor's queue, which better represents the conceptual structure of
the master's pending tasks:

* Today we use a priority queue to allow important tasks to preempt less-important ones. However there are only a small number of priority levels, so it is simpler to maintain a queue for each priority, effectively replacing the sorting within the priority queue with a radix sort.

* Today when a task is submitted we perform a map lookup to see if it can be added to an existing batch or not. With this change we allow client code to create its own dedicated queue of tasks. The entries in the per-priority-level queues are themselves queues, one for each executor, representing the batches to be run.

* Today each task in the queue holds a reference to its executor, but the executor used to run a task may belong to a different task in the same batch. In practice we know they're the same executor (that's how batches are defined) but we cannot express this knowledge in the type system so we have to do a bunch of unchecked casting to work around it. With this change we associate each per-executor queue directly with its executor, avoiding the need to do all this unchecked casting.

* Today the master service must block its thread while waiting for each task to complete, because otherwise the executor would start to process the next task in the queue. This makes testing using a `DeterministicTaskQueue` harder (see `FakeThreadPoolMasterService`). This change avoids enqueueing tasks on the `ThreadPoolExecutor` unless there is genuinely work to do, although it leaves the removal of the actual blocking to a followup.

Closes #81626
2023-02-23 08:01:03 -05:00
Simon Cooper 8666136894
Remove some references to Version.transportVersion (#93861) 2023-02-20 11:55:30 +00:00
Andrei Dan fb033b9e82
Move SchedulerEngine and TimeValueSchedule to server/common/scheduler (#93862)
We built quite a bit of infrastructure to have one polling job
running via the `SchedulerEngine` and `ActiveSchedule`. This moves this
infrastructure outside x-pack to server so elasticsearch/modules can use
it and avoid re-implementing it using `threadPool.schedule`.
2023-02-17 08:55:40 +00:00
Yang Wang 26d01b71bd
Ensure search features work with the new RCS model (#93720)
This PR ensures most search features (scroll, async search, pit, field
caps, msearch, vector tile etc) work with the new RCS model. The main
code change is tested by adapting the common yaml CCS tests to use the
new RCS model to provide a broad test coverage. The tests ensure the new
RCS model works from search's perspective. We could still use more tests
from security's perspective, e.g. DLS/FLS, in separate PRs.

Note:  * Eql yaml test files are not located under `x-pack/plugin` and
this makes it hard to reuse. It should be possible to relocate them. But
I'll address it separately.  * Sql yaml requires special transformation
to work. I'll also have it separately.
2023-02-15 21:10:56 -05:00
Simon Cooper 4c46ccacaa
Migrate the remaining uses of Version to TransportVersion (#93384)
Remove get/setVersion methods
2023-02-13 09:15:53 +00:00
William Brafford b89fab2f01
Stop suggesting feature migrations for 7.x indices (#93666)
* Don't report MIGRATION_NEEDED for 7.x indices

Eventually, we will need to migrate 7.x indices to 8.x before doing a
significant upgrade of Lucene. However, the migrations to 8.x are not
adequately tested: while they will eventually be needed, they are not
currently needed, and may in fact produce bugs.

This change will ensure that the GET _migration/system_feature API
returns NO_MIGRATION_NEEDED in 8.x. We will begin to require
migrations once we start testing for the next major version upgrade.
2023-02-10 11:58:54 -05:00
David Turner f068cfda18
Only simulate legal desired moves (#93635)
Today when setting up for the desired balance computation we move all
shards to their desired locations without checking any allocation rules.
However, certain allocation rules (e.g. those related to node versions
and shutdowns) may prevent these movements in reality, resulting in a
shard which cannot move to its desired location but which may not remain
on its current node either.

This commit adds some checks to verify that these preliminary moves are
still legal when setting up the computation.

Closes #93271
2023-02-09 08:44:30 -05:00
Ievgen Degtiarenko e887c97282
Fix desired balance spec (#93617)
Spec relied on a presence of a node with `test-cluster-0` name.
This change reads the name from the cluster state instead.
2023-02-09 11:37:04 +01:00
David Turner 438f2f8daf Mute flaky testSnapshotBasedRecovery
Relates #93271
2023-02-06 17:48:22 +00:00
David Turner afc24e1326
More logging for testSnapshotBasedRecovery (#93513)
Relates #93271
2023-02-06 07:42:45 -05:00
Ievgen Degtiarenko ab5ae88919
Expose forecasted and actual disk usage per tier and node (#93497) 2023-02-06 13:34:18 +01:00
Mark Vieira 43d9a6a0c8
Convert full cluster restart tests to new rest testing framework (#93477) 2023-02-02 13:13:54 -08:00
Ievgen Degtiarenko 513dc2f24f
Expose per node counts (#93439) 2023-02-02 16:13:01 +01:00
David Turner eb9eeae5ed
More investigation into 93271 (#93454)
We still don't properly understand why this test is failing, and it
doesn't reproduce locally, so this commit adds a little extra logging to
capture extra detail from a failure in CI.
2023-02-02 07:03:51 -05:00
Nikolaj Volgushev 221c93531b
Revert "Convert full cluster restart tests to new rest testing framework (#93422)" (#93444)
Reverts #93422

Should address: #93442 and possibly #93440
2023-02-02 11:29:41 +01:00
Mark Vieira 820ba5af23
Convert full cluster restart tests to new rest testing framework (#93422) 2023-02-01 11:34:21 -08:00
Craig Taverner bc7a31fd08
Revert "Convert full cluster restart tests to new rest testing framework (#93062)" (#93407)
This reverts commit 013b2e5d5e.
2023-02-01 12:57:50 +01:00
Mark Vieira 013b2e5d5e
Convert full cluster restart tests to new rest testing framework (#93062) 2023-01-31 12:26:45 -08:00
Simon Cooper f086dd18dd
Migrate misc packages to TransportVersion (#93272) 2023-01-31 11:24:32 +00:00
Ievgen Degtiarenko 7b9df003b9
Disable unnecessary logs collection (#93339) 2023-01-30 13:16:19 +01:00