Skip to content

Commit fe9b3fa

Browse files
authored
Merge branch 'main' into bc_upgrades/tolerate_incompatible_versions
2 parents 60ae001 + 449ec6b commit fe9b3fa

File tree

104 files changed

+3081
-3052
lines changed

Some content is hidden

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

104 files changed

+3081
-3052
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,18 @@ Alternative manual steps for IntelliJ.
203203
3. Navigate to the file `build-conventions/formatterConfig.xml`
204204
4. Click "OK"
205205

206+
#### Options
207+
208+
When importing to IntelliJ, we offer a few options that can be used to
209+
configure the behaviour of the import:
210+
211+
| Property | Description | Values (* = default) |
212+
|--------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------|
213+
| `org.elasticsearch.idea-configuration-cache` | Should IntelliJ enable the Gradle Configuration cache to speed up builds when generating run configs | *`true`, `false` |
214+
| `org.elasticsearch.idea-delegate-to-gradle` | Should IntelliJ use Gradle for all generated run / test configs or prompt each time | `true`, *`false` |
215+
216+
These options can be set anywhere on the Gradle config path including in `~/.gradle/gradle.properties`
217+
206218
### REST endpoint conventions
207219

208220
Elasticsearch typically uses singular nouns rather than plurals in URLs.

build-tools-internal/src/main/groovy/elasticsearch.ide.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
180180
// this path is produced by the extractLibs task above
181181
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
182182
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
183+
def delegateToGradle = providers.gradleProperty("org.elasticsearch.idea-delegate-to-gradle").getOrElse("false").toBoolean()
183184
idea {
184185
project {
185186
vcs = 'Git'
@@ -188,7 +189,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
188189
settings {
189190
delegateActions {
190191
delegateBuildRunToGradle = false
191-
testRunner = 'choose_per_test'
192+
testRunner = delegateToGradle ? 'gradle' : 'choose_per_test'
192193
}
193194
taskTriggers {
194195
afterSync tasks.named('configureIdeCheckstyle'),

docs/changelog/129464.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pr: 129464
2+
summary: Deprecate `indices.merge.scheduler.use_thread_pool` setting
3+
area: Engine
4+
type: deprecation
5+
issues: []
6+
deprecation:
7+
title: Deprecate `indices.merge.scheduler.use_thread_pool` setting
8+
area: Ingest
9+
details: This deprecates the `indices.merge.scheduler.use_thread_pool` node setting that was introduced in #120869. This setting should not normally be used, unless instructed so by engineering to get around temporary issues with the new threadpool-based merge scheduler.
10+
impact: There should be no impact to users since the setting was not released before its deprecation here (and is not documented).

libs/simdvec/src/test/java/org/elasticsearch/simdvec/internal/vectorization/ES91OSQVectorScorerTests.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,21 @@ public void testScore() throws Exception {
125125
scores2
126126
);
127127
for (int j = 0; j < ES91OSQVectorsScorer.BULK_SIZE; j++) {
128-
if (scores1[j] > (maxDims * Short.MAX_VALUE)) {
129-
int diff = (int) (scores1[j] - scores2[j]);
130-
assertThat("defaultScores: " + scores1[j] + " bulkScores: " + scores2[j], Math.abs(diff), lessThan(65));
131-
} else if (scores1[j] > (maxDims * Byte.MAX_VALUE)) {
132-
int diff = (int) (scores1[j] - scores2[j]);
133-
assertThat("defaultScores: " + scores1[j] + " bulkScores: " + scores2[j], Math.abs(diff), lessThan(9));
128+
if (scores1[j] == scores2[j]) {
129+
continue;
130+
}
131+
if (scores1[j] > (maxDims * Byte.MAX_VALUE)) {
132+
float diff = Math.abs(scores1[j] - scores2[j]);
133+
assertThat(
134+
"defaultScores: " + scores1[j] + " bulkScores: " + scores2[j],
135+
diff / scores1[j],
136+
lessThan(1e-5f)
137+
);
138+
assertThat(
139+
"defaultScores: " + scores1[j] + " bulkScores: " + scores2[j],
140+
diff / scores2[j],
141+
lessThan(1e-5f)
142+
);
134143
} else {
135144
assertEquals(scores1[j], scores2[j], 1e-2f);
136145
}

muted-tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,21 @@ tests:
571571
- class: org.elasticsearch.search.query.VectorIT
572572
method: testFilteredQueryStrategy
573573
issue: https://github.com/elastic/elasticsearch/issues/129517
574-
- class: org.elasticsearch.xpack.esql.parser.StatementParserTests
575-
method: testInvalidJoinPatterns
576-
issue: https://github.com/elastic/elasticsearch/issues/129598
574+
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
575+
method: test
576+
issue: https://github.com/elastic/elasticsearch/issues/129453
577+
- class: org.elasticsearch.server.cli.MachineDependentHeapTests
578+
method: testMlOnlyOptions
579+
issue: https://github.com/elastic/elasticsearch/issues/129236
580+
- class: org.elasticsearch.upgrades.RunningSnapshotIT
581+
method: testRunningSnapshotCompleteAfterUpgrade {upgradedNodes=1}
582+
issue: https://github.com/elastic/elasticsearch/issues/129644
583+
- class: org.elasticsearch.upgrades.RunningSnapshotIT
584+
method: testRunningSnapshotCompleteAfterUpgrade {upgradedNodes=2}
585+
issue: https://github.com/elastic/elasticsearch/issues/129645
586+
- class: org.elasticsearch.upgrades.RunningSnapshotIT
587+
method: testRunningSnapshotCompleteAfterUpgrade {upgradedNodes=3}
588+
issue: https://github.com/elastic/elasticsearch/issues/129646
577589

578590
# Examples:
579591
#

qa/smoke-test-multinode/src/yamlRestTest/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class SmokeTestMultiNodeClientYamlTestSuiteIT extends ESClientYamlSuiteTe
3838
.feature(FeatureFlag.SUB_OBJECTS_AUTO_ENABLED)
3939
.feature(FeatureFlag.DOC_VALUES_SKIPPER)
4040
.feature(FeatureFlag.USE_LUCENE101_POSTINGS_FORMAT)
41+
.feature(FeatureFlag.IVF_FORMAT)
4142
.build();
4243

4344
public SmokeTestMultiNodeClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static TransportVersion def(int id) {
197197
public static final TransportVersion NONE_CHUNKING_STRATEGY_8_19 = def(8_841_0_49);
198198
public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19 = def(8_841_0_50);
199199
public static final TransportVersion SETTINGS_IN_DATA_STREAMS_8_19 = def(8_841_0_51);
200+
public static final TransportVersion ML_INFERENCE_CUSTOM_SERVICE_REMOVE_ERROR_PARSING_8_19 = def(8_841_0_52);
200201
public static final TransportVersion V_9_0_0 = def(9_000_0_09);
201202
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
202203
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);
@@ -302,6 +303,7 @@ static TransportVersion def(int id) {
302303
public static final TransportVersion SECURITY_CLOUD_API_KEY_REALM_AND_TYPE = def(9_099_0_00);
303304
public static final TransportVersion STATE_PARAM_GET_SNAPSHOT = def(9_100_0_00);
304305
public static final TransportVersion PROJECT_ID_IN_SNAPSHOTS_DELETIONS_AND_REPO_CLEANUP = def(9_101_0_00);
306+
public static final TransportVersion ML_INFERENCE_CUSTOM_SERVICE_REMOVE_ERROR_PARSING = def(9_102_0_00);
305307

306308
/*
307309
* STOP! READ THIS FIRST! No, really,

server/src/main/java/org/elasticsearch/cluster/ClusterState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ public ClusterState copyAndUpdateMetadata(Consumer<Metadata.Builder> updater) {
10051005
}
10061006

10071007
public ClusterState copyAndUpdateProject(ProjectId projectId, Consumer<ProjectMetadata.Builder> updater) {
1008-
return copyAndUpdate(builder -> builder.putProjectMetadata(metadata().getProject(projectId).copyAndUpdate(updater)));
1008+
return copyAndUpdate(builder -> builder.metadata(metadata.copyAndUpdateProject(projectId, updater)));
10091009
}
10101010

10111011
@SuppressForbidden(reason = "directly reading ClusterState#clusterFeatures")

server/src/main/java/org/elasticsearch/cluster/ProjectState.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ public int hashCode() {
7373
public ClusterState updatedState(Consumer<ProjectMetadata.Builder> projectBuilderConsumer) {
7474
ProjectMetadata.Builder projectBuilder = ProjectMetadata.builder(metadata());
7575
projectBuilderConsumer.accept(projectBuilder);
76-
return ClusterState.builder(cluster).putProjectMetadata(projectBuilder).build();
76+
return updatedState(projectBuilder.build());
7777
}
7878

7979
/**
8080
* Build a new {@link ClusterState} with the updated project.
8181
*/
8282
public ClusterState updatedState(ProjectMetadata updatedProject) {
83-
return ClusterState.builder(cluster).putProjectMetadata(updatedProject).build();
83+
return ClusterState.builder(cluster).metadata(cluster.metadata().withUpdatedProject(updatedProject)).build();
8484
}
8585

8686
/**
@@ -100,6 +100,6 @@ public ProjectState updateProject(ProjectMetadata updatedProject) {
100100
)
101101
);
102102
}
103-
return new ProjectState(ClusterState.builder(cluster).putProjectMetadata(updatedProject).build(), project);
103+
return new ProjectState(updatedState(updatedProject), project);
104104
}
105105
}

server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,44 @@ private Metadata updateSingleProject(Function<ProjectMetadata, ProjectMetadata>
404404
}
405405
}
406406

407+
/**
408+
* Updates a single project in the metadata. This offers a more performant way of updating a single project compared to the Builder.
409+
*/
410+
@FixForMultiProject // We should reconsider whether this method is valuable once we update Metadata.Builder to hold constructed projects
411+
// instead of project builders.
412+
public Metadata withUpdatedProject(ProjectMetadata updatedProject) {
413+
final var existingProject = projectMetadata.get(updatedProject.id());
414+
if (existingProject == null) {
415+
throw new IllegalArgumentException(
416+
"Can only update existing project, cannot add a new project [" + updatedProject.id() + "]. Use the builder instead"
417+
);
418+
}
419+
if (updatedProject == existingProject) {
420+
return this;
421+
}
422+
final Map<ProjectId, ProjectMetadata> updatedMap;
423+
if (projects().size() == 1) {
424+
updatedMap = Map.of(updatedProject.id(), updatedProject);
425+
} else {
426+
final var hashMap = new HashMap<>(projectMetadata);
427+
hashMap.put(updatedProject.id(), updatedProject);
428+
updatedMap = Collections.unmodifiableMap(hashMap);
429+
}
430+
return new Metadata(
431+
clusterUUID,
432+
clusterUUIDCommitted,
433+
version,
434+
coordinationMetadata,
435+
updatedMap,
436+
transientSettings,
437+
persistentSettings,
438+
settings,
439+
hashesOfConsistentSettings,
440+
customs,
441+
reservedStateMetadata
442+
);
443+
}
444+
407445
public long version() {
408446
return this.version;
409447
}
@@ -1487,6 +1525,18 @@ public Metadata copyAndUpdate(Consumer<Builder> updater) {
14871525
return builder.build();
14881526
}
14891527

1528+
public Metadata copyAndUpdateProject(ProjectId projectId, Consumer<ProjectMetadata.Builder> updater) {
1529+
final var existingProject = projectMetadata.get(projectId);
1530+
if (existingProject == null) {
1531+
throw new IllegalArgumentException(
1532+
"Can only update existing project, cannot add a new project [" + projectId + "]. Use the builder instead"
1533+
);
1534+
}
1535+
final var builder = ProjectMetadata.builder(existingProject);
1536+
updater.accept(builder);
1537+
return withUpdatedProject(builder.build());
1538+
}
1539+
14901540
public static class Builder {
14911541

14921542
private String clusterUUID;

0 commit comments

Comments
 (0)