Skip to content

Commit f0374b3

Browse files
committed
Merge branch 'main' into failure-store-security-poc
2 parents 45de638 + 95c9b4b commit f0374b3

File tree

86 files changed

+2842
-2573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2842
-2573
lines changed

docs/changelog/120807.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/121240.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121240
2+
summary: Implement runtime skip_unavailable=true
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/121256.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121256
2+
summary: Run `TransportEnrichStatsAction` on local node
3+
area: Ingest Node
4+
type: enhancement
5+
issues: []

docs/changelog/121556.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121556
2+
summary: Enable New Semantic Text Format Only On Newly Created Indices
3+
area: Mapping
4+
type: bug
5+
issues: []

libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/DummyImplementations.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@
5252
* <p>
5353
* A bit like Mockito but way more painful.
5454
*/
55-
public class DummyImplementations {
55+
class DummyImplementations {
56+
57+
static class DummyLocaleServiceProvider extends LocaleServiceProvider {
5658

57-
public static class DummyLocaleServiceProvider extends LocaleServiceProvider {
5859
@Override
5960
public Locale[] getAvailableLocales() {
6061
throw unexpected();

libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/RestEntitlementsCheckAction.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ static CheckAction alwaysDenied(CheckedRunnable<Exception> action) {
9696

9797
private static final Map<String, CheckAction> checkActions = Stream.concat(
9898
Stream.<Entry<String, CheckAction>>of(
99-
entry("static_reflection", deniedToPlugins(RestEntitlementsCheckAction::staticMethodNeverEntitledViaReflection)),
100-
entry("nonstatic_reflection", deniedToPlugins(RestEntitlementsCheckAction::nonstaticMethodNeverEntitledViaReflection)),
101-
entry("constructor_reflection", deniedToPlugins(RestEntitlementsCheckAction::constructorNeverEntitledViaReflection)),
10299
entry("runtime_exit", deniedToPlugins(RestEntitlementsCheckAction::runtimeExit)),
103100
entry("runtime_halt", deniedToPlugins(RestEntitlementsCheckAction::runtimeHalt)),
104101
entry("system_exit", deniedToPlugins(RestEntitlementsCheckAction::systemExit)),
@@ -341,11 +338,6 @@ private static void systemExit() {
341338
System.exit(123);
342339
}
343340

344-
private static void staticMethodNeverEntitledViaReflection() throws Exception {
345-
Method systemExit = System.class.getMethod("exit", int.class);
346-
systemExit.invoke(null, 123);
347-
}
348-
349341
private static void createClassLoader() throws IOException {
350342
try (var classLoader = new URLClassLoader("test", new URL[0], RestEntitlementsCheckAction.class.getClassLoader())) {
351343
logger.info("Created URLClassLoader [{}]", classLoader.getName());
@@ -356,11 +348,6 @@ private static void processBuilder_start() throws IOException {
356348
new ProcessBuilder("").start();
357349
}
358350

359-
private static void nonstaticMethodNeverEntitledViaReflection() throws Exception {
360-
Method processBuilderStart = ProcessBuilder.class.getMethod("start");
361-
processBuilderStart.invoke(new ProcessBuilder(""));
362-
}
363-
364351
private static void processBuilder_startPipeline() throws IOException {
365352
ProcessBuilder.startPipeline(List.of());
366353
}
@@ -399,10 +386,6 @@ private static void setHttpsConnectionProperties() {
399386
new DummyLocaleServiceProvider();
400387
}
401388

402-
private static void constructorNeverEntitledViaReflection() throws Exception {
403-
DummyLocaleServiceProvider.class.getConstructor().newInstance();
404-
}
405-
406389
private static void breakIteratorProvider$() {
407390
new DummyBreakIteratorProvider();
408391
}

muted-tests.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,9 @@ tests:
122122
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
123123
method: test {p0=search.highlight/50_synthetic_source/text multi unified from vectors}
124124
issue: https://github.com/elastic/elasticsearch/issues/117815
125-
- class: org.elasticsearch.xpack.esql.plugin.ClusterRequestTests
126-
method: testFallbackIndicesOptions
127-
issue: https://github.com/elastic/elasticsearch/issues/117937
128125
- class: org.elasticsearch.xpack.ml.integration.RegressionIT
129126
method: testTwoJobsWithSameRandomizeSeedUseSameTrainingSet
130127
issue: https://github.com/elastic/elasticsearch/issues/117805
131-
- class: org.elasticsearch.xpack.esql.action.EsqlActionTaskIT
132-
method: testCancelRequestWhenFailingFetchingPages
133-
issue: https://github.com/elastic/elasticsearch/issues/118193
134128
- class: org.elasticsearch.packaging.test.ArchiveTests
135129
method: test44AutoConfigurationNotTriggeredOnNotWriteableConfDir
136130
issue: https://github.com/elastic/elasticsearch/issues/118208
@@ -215,8 +209,6 @@ tests:
215209
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncEnrichStopIT
216210
method: testEnrichAfterStop
217211
issue: https://github.com/elastic/elasticsearch/issues/120757
218-
- class: org.elasticsearch.search.fieldcaps.FieldCapabilitiesIT
219-
issue: https://github.com/elastic/elasticsearch/issues/120772
220212
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
221213
method: test {p0=ml/3rd_party_deployment/Test start deployment fails while model download in progress}
222214
issue: https://github.com/elastic/elasticsearch/issues/120810
@@ -384,9 +376,6 @@ tests:
384376
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
385377
method: testDependentVariableIsAliasToNested
386378
issue: https://github.com/elastic/elasticsearch/issues/121415
387-
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
388-
method: testLookupExplosionBigStringManyMatches
389-
issue: https://github.com/elastic/elasticsearch/issues/121465
390379
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
391380
method: testClientSecretRotation
392381
issue: https://github.com/elastic/elasticsearch/issues/120985
@@ -396,9 +385,6 @@ tests:
396385
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
397386
method: test {yaml=cluster.health/10_basic/cluster health basic test}
398387
issue: https://github.com/elastic/elasticsearch/issues/121478
399-
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
400-
method: testLookupExplosionManyMatches
401-
issue: https://github.com/elastic/elasticsearch/issues/121481
402388
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
403389
method: testGetUsersWithProfileUid
404390
issue: https://github.com/elastic/elasticsearch/issues/121483
@@ -408,15 +394,6 @@ tests:
408394
- class: org.elasticsearch.xpack.transform.checkpoint.TransformCCSCanMatchIT
409395
method: testTransformLifecycle_RangeQueryThatMatchesNoShards
410396
issue: https://github.com/elastic/elasticsearch/issues/121480
411-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
412-
method: testStopQueryLocal
413-
issue: https://github.com/elastic/elasticsearch/issues/121487
414-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
415-
method: testSuccessfulPathways
416-
issue: https://github.com/elastic/elasticsearch/issues/121488
417-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
418-
method: testAsyncQueriesWithLimit0
419-
issue: https://github.com/elastic/elasticsearch/issues/121489
420397
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
421398
method: testSuggestProfilesWithHint
422399
issue: https://github.com/elastic/elasticsearch/issues/121116
@@ -449,6 +426,21 @@ tests:
449426
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
450427
method: test {yaml=snapshot.create/10_basic/Create a snapshot for missing index}
451428
issue: https://github.com/elastic/elasticsearch/issues/121536
429+
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryUnavailableRemotesIT
430+
method: testRemoteOnlyCCSAgainstDisconnectedRemoteWithSkipUnavailableTrue
431+
issue: https://github.com/elastic/elasticsearch/issues/121578
432+
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
433+
method: testTasks
434+
issue: https://github.com/elastic/elasticsearch/issues/121626
435+
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
436+
method: testCloseSkipUnavailable
437+
issue: https://github.com/elastic/elasticsearch/issues/121627
438+
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
439+
method: testCancel
440+
issue: https://github.com/elastic/elasticsearch/issues/121632
441+
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
442+
method: testCancelSkipUnavailable
443+
issue: https://github.com/elastic/elasticsearch/issues/121631
452444

453445
# Examples:
454446
#

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/SourceModeRollingUpgradeIT.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import java.util.List;
1919
import java.util.Map;
2020

21-
import static org.hamcrest.Matchers.containsString;
2221
import static org.hamcrest.Matchers.equalTo;
2322

2423
public class SourceModeRollingUpgradeIT extends AbstractRollingUpgradeTestCase {
@@ -83,20 +82,10 @@ public void testConfigureStoredSourceWhenIndexIsCreatedLegacy() throws IOExcepti
8382
private void assertDeprecationWarningForTemplate(String templateName) throws IOException {
8483
var request = new Request("GET", "/_migration/deprecations");
8584
var response = entityAsMap(client().performRequest(request));
86-
if (response.containsKey("templates")) {
87-
// Check the newer version of the deprecation API that contains the templates section
88-
Map<?, ?> issuesByTemplate = (Map<?, ?>) response.get("templates");
89-
assertThat(issuesByTemplate.containsKey(templateName), equalTo(true));
90-
var templateIssues = (List<?>) issuesByTemplate.get(templateName);
91-
assertThat(((Map<?, ?>) templateIssues.getFirst()).get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
92-
} else {
93-
// Bwc version with 8.18 until https://github.com/elastic/elasticsearch/pull/120505/ gets backported, clean up after backport
94-
var nodeSettings = (Map<?, ?>) ((List<?>) response.get("node_settings")).getFirst();
95-
assertThat(nodeSettings.get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
96-
assertThat(
97-
(String) nodeSettings.get("details"),
98-
containsString(SourceFieldMapper.DEPRECATION_WARNING + " Affected component templates: [" + templateName + "]")
99-
);
100-
}
85+
assertThat(response.containsKey("templates"), equalTo(true));
86+
Map<?, ?> issuesByTemplate = (Map<?, ?>) response.get("templates");
87+
assertThat(issuesByTemplate.containsKey(templateName), equalTo(true));
88+
var templateIssues = (List<?>) issuesByTemplate.get(templateName);
89+
assertThat(((Map<?, ?>) templateIssues.getFirst()).get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
10190
}
10291
}

rest-api-spec/src/main/resources/rest-api-spec/api/enrich.stats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"params": {
2121
"master_timeout":{
2222
"type":"time",
23-
"description":"Timeout for processing on master node"
23+
"description":"Timeout for waiting for new cluster state in case it is blocked"
2424
}
2525
}
2626
}

server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.client.Cancellable;
2929
import org.elasticsearch.client.Request;
3030
import org.elasticsearch.client.Response;
31+
import org.elasticsearch.cluster.ClusterState;
3132
import org.elasticsearch.cluster.metadata.IndexMetadata;
3233
import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand;
3334
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider;
@@ -73,6 +74,7 @@
7374
import java.util.Collection;
7475
import java.util.Collections;
7576
import java.util.HashMap;
77+
import java.util.HashSet;
7678
import java.util.List;
7779
import java.util.Map;
7880
import java.util.concurrent.CancellationException;
@@ -591,21 +593,31 @@ public void testNoActiveCopy() throws Exception {
591593

592594
private void moveOrCloseShardsOnNodes(String nodeName) throws Exception {
593595
final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, nodeName);
596+
final ClusterState clusterState = clusterService().state();
594597
for (IndexService indexService : indicesService) {
595598
for (IndexShard indexShard : indexService) {
596599
if (randomBoolean()) {
597600
closeShardNoCheck(indexShard, randomBoolean());
598601
} else if (randomBoolean()) {
599602
final ShardId shardId = indexShard.shardId();
600-
603+
final var assignedNodes = new HashSet<>();
604+
clusterState.routingTable().shardRoutingTable(shardId).allShards().forEach(shr -> {
605+
if (shr.currentNodeId() != null) {
606+
assignedNodes.add(shr.currentNodeId());
607+
}
608+
if (shr.relocatingNodeId() != null) {
609+
assignedNodes.add(shr.relocatingNodeId());
610+
}
611+
});
601612
final var targetNodes = new ArrayList<String>();
602613
for (final var targetIndicesService : internalCluster().getInstances(IndicesService.class)) {
603614
final var targetNode = targetIndicesService.clusterService().localNode();
604-
if (targetNode.canContainData() && targetIndicesService.getShardOrNull(shardId) == null) {
615+
if (targetNode.canContainData()
616+
&& targetIndicesService.getShardOrNull(shardId) == null
617+
&& assignedNodes.contains(targetNode.getId()) == false) {
605618
targetNodes.add(targetNode.getId());
606619
}
607620
}
608-
609621
if (targetNodes.isEmpty()) {
610622
continue;
611623
}

0 commit comments

Comments
 (0)