Skip to content

Commit 8ce82a9

Browse files
committed
Merge branch 'main' into 2025/11/06/transport-mtls-docs
2 parents dd98a06 + afd3a42 commit 8ce82a9

File tree

30 files changed

+2131
-813
lines changed

30 files changed

+2131
-813
lines changed

docs/changelog/137395.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 137395
2+
summary: Fix attribute only in full text function not found
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 137396

docs/changelog/137476.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 137476
2+
summary: Handle missing geotile buckets
3+
area: Transform
4+
type: bug
5+
issues:
6+
- 126591

docs/changelog/137671.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137671
2+
summary: "[LTR] Fix feature display order when using explain"
3+
area: Search
4+
type: bug
5+
issues: []

libs/tdigest/src/test/java/org/elasticsearch/tdigest/BigCountTests.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121

2222
package org.elasticsearch.tdigest;
2323

24+
import static org.hamcrest.Matchers.lessThanOrEqualTo;
25+
2426
public abstract class BigCountTests extends TDigestTestCase {
2527

2628
public void testBigMerge() {
27-
try (TDigest digest = createDigest()) {
29+
try (TDigest digest = createDigest(100)) {
2830
for (int i = 0; i < 5; i++) {
2931
try (TDigest digestToMerge = getDigest()) {
3032
digest.add(digestToMerge);
@@ -35,13 +37,25 @@ public void testBigMerge() {
3537
}
3638
}
3739

40+
/**
41+
* Verify that, at a range of compression values, the size of the produced digest is not much larger than 10 times the compression
42+
*/
43+
public void testCompression() {
44+
for (int compression : new int[] { 100, 500, 1000, 10000 }) {
45+
try (TDigest digest = createDigest(compression)) {
46+
addData(digest);
47+
assertThat("Compression = " + compression, digest.centroidCount(), lessThanOrEqualTo(compression * 10));
48+
}
49+
}
50+
}
51+
3852
private TDigest getDigest() {
39-
TDigest digest = createDigest();
53+
TDigest digest = createDigest(100);
4054
addData(digest);
4155
return digest;
4256
}
4357

44-
public TDigest createDigest() {
58+
public TDigest createDigest(int compression) {
4559
throw new IllegalStateException("Should have over-ridden createDigest");
4660
}
4761

libs/tdigest/src/test/java/org/elasticsearch/tdigest/BigCountTestsMergingDigestTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
public class BigCountTestsMergingDigestTests extends BigCountTests {
2525
@Override
26-
public TDigest createDigest() {
27-
return TDigest.createMergingDigest(arrays(), 100);
26+
public TDigest createDigest(int compression) {
27+
return TDigest.createMergingDigest(arrays(), compression);
2828
}
2929
}

libs/tdigest/src/test/java/org/elasticsearch/tdigest/BigCountTestsTreeDigestTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
public class BigCountTestsTreeDigestTests extends BigCountTests {
2525
@Override
26-
public TDigest createDigest() {
27-
return TDigest.createAvlTreeDigest(arrays(), 100);
26+
public TDigest createDigest(int compression) {
27+
return TDigest.createAvlTreeDigest(arrays(), compression);
2828
}
2929
}

muted-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,6 @@ tests:
423423
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
424424
method: testMultipleInferencesTriggeringDownloadAndDeploy
425425
issue: https://github.com/elastic/elasticsearch/issues/117208
426-
- class: org.elasticsearch.reservedstate.service.ComponentTemplatesFileSettingsIT
427-
method: testSettingsApplied
428-
issue: https://github.com/elastic/elasticsearch/issues/137258
429426
- class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT
430427
method: test {p0=esql/40_tsdb/error on rename timestamp}
431428
issue: https://github.com/elastic/elasticsearch/issues/137259
@@ -470,6 +467,12 @@ tests:
470467
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeMetricsIT
471468
method: test
472469
issue: https://github.com/elastic/elasticsearch/issues/137655
470+
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterBasicLicenseIT
471+
method: testLicenseInvalidForInference {p0=true}
472+
issue: https://github.com/elastic/elasticsearch/issues/137690
473+
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterBasicLicenseIT
474+
method: testLicenseInvalidForInference {p0=false}
475+
issue: https://github.com/elastic/elasticsearch/issues/137691
473476

474477
# Examples:
475478
#

server/src/internalClusterTest/java/org/elasticsearch/reservedstate/service/ComponentTemplatesFileSettingsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ private void assertClusterStateSaveOK(CountDownLatch savedClusterState, AtomicLo
386386
boolean awaitSuccessful = savedClusterState.await(20, TimeUnit.SECONDS);
387387
assertTrue(awaitSuccessful);
388388

389+
awaitMasterNode();
389390
final ClusterStateResponse clusterStateResponse = clusterAdmin().state(
390391
new ClusterStateRequest(TEST_REQUEST_TIMEOUT).waitForMetadataVersion(metadataVersion.get())
391392
).actionGet();
@@ -532,8 +533,7 @@ public void testSettingsApplied() throws Exception {
532533
writeJSONFile(dataNode, testJSON);
533534

534535
logger.info("--> start master node");
535-
final String masterNode = internalCluster().startMasterOnlyNode();
536-
awaitMasterNode(internalCluster().getNonMasterNodeName(), masterNode);
536+
internalCluster().startMasterOnlyNode();
537537

538538
assertClusterStateSaveOK(savedClusterState.v1(), savedClusterState.v2());
539539

server/src/main/java/org/elasticsearch/index/codec/vectors/es93/DirectIOCapableLucene99FlatVectorsFormat.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,22 +266,25 @@ public void nextDocsAndScores(int nextCount, Bits liveDocs, DocAndFloatFeatureBu
266266
buffer.docs[size++] = indexIterator.index();
267267
}
268268
}
269-
int loopBound = size - (size % bulkSize);
269+
final int firstBulkSize = Math.min(bulkSize, size);
270+
for (int j = 0; j < firstBulkSize; j++) {
271+
final long ord = buffer.docs[j];
272+
inputSlice.prefetch(ord * byteSize, byteSize);
273+
}
274+
final int loopBound = size - (size % bulkSize);
270275
int i = 0;
271276
for (; i < loopBound; i += bulkSize) {
272-
for (int j = 0; j < bulkSize; j++) {
273-
long ord = buffer.docs[i + j];
277+
final int nextI = i + bulkSize;
278+
final int nextBulkSize = Math.min(bulkSize, size - nextI);
279+
for (int j = 0; j < nextBulkSize; j++) {
280+
final long ord = buffer.docs[nextI + j];
274281
inputSlice.prefetch(ord * byteSize, byteSize);
275282
}
276283
System.arraycopy(buffer.docs, i, docBuffer, 0, bulkSize);
277284
inner.bulkScore(docBuffer, scoreBuffer, bulkSize);
278285
System.arraycopy(scoreBuffer, 0, buffer.features, i, bulkSize);
279286
}
280-
int countLeft = size - i;
281-
for (int j = i; j < size; j++) {
282-
long ord = buffer.docs[j];
283-
inputSlice.prefetch(ord * byteSize, byteSize);
284-
}
287+
final int countLeft = size - i;
285288
System.arraycopy(buffer.docs, i, docBuffer, 0, countLeft);
286289
inner.bulkScore(docBuffer, scoreBuffer, countLeft);
287290
System.arraycopy(scoreBuffer, 0, buffer.features, i, countLeft);

server/src/main/java/org/elasticsearch/index/mapper/IdLoader.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,53 @@
1818
import org.elasticsearch.cluster.metadata.DataStream;
1919
import org.elasticsearch.cluster.routing.IndexRouting;
2020
import org.elasticsearch.cluster.routing.RoutingHashBuilder;
21+
import org.elasticsearch.index.IndexMode;
22+
import org.elasticsearch.index.IndexVersions;
2123
import org.elasticsearch.index.fieldvisitor.LeafStoredFieldLoader;
2224

2325
import java.io.IOException;
26+
import java.util.ArrayList;
2427
import java.util.List;
28+
import java.util.Set;
29+
import java.util.TreeSet;
2530

2631
/**
2732
* Responsible for loading the _id from stored fields or for TSDB synthesizing the _id from the routing, _tsid and @timestamp fields.
2833
*/
2934
public sealed interface IdLoader permits IdLoader.TsIdLoader, IdLoader.StoredIdLoader {
3035

36+
/**
37+
* @return returns an {@link IdLoader} instance to load the value of the _id field.
38+
*/
39+
static IdLoader create(MapperService mapperService) {
40+
var indexSettings = mapperService.getIndexSettings();
41+
if (indexSettings.getMode() == IndexMode.TIME_SERIES) {
42+
IndexRouting.ExtractFromSource.ForRoutingPath indexRouting = null;
43+
List<String> routingPaths = null;
44+
if (indexSettings.getIndexVersionCreated().before(IndexVersions.TIME_SERIES_ROUTING_HASH_IN_ID)) {
45+
indexRouting = (IndexRouting.ExtractFromSource.ForRoutingPath) indexSettings.getIndexRouting();
46+
routingPaths = indexSettings.getIndexMetadata().getRoutingPaths();
47+
for (String routingField : routingPaths) {
48+
if (routingField.contains("*")) {
49+
// In case the routing fields include path matches, find any matches and add them as distinct fields
50+
// to the routing path.
51+
Set<String> matchingRoutingPaths = new TreeSet<>(routingPaths);
52+
for (Mapper mapper : mapperService.mappingLookup().fieldMappers()) {
53+
if (mapper instanceof KeywordFieldMapper && indexRouting.matchesField(mapper.fullPath())) {
54+
matchingRoutingPaths.add(mapper.fullPath());
55+
}
56+
}
57+
routingPaths = new ArrayList<>(matchingRoutingPaths);
58+
break;
59+
}
60+
}
61+
}
62+
return createTsIdLoader(indexRouting, routingPaths, indexSettings.useTimeSeriesSyntheticId());
63+
} else {
64+
return fromLeafStoredFieldLoader();
65+
}
66+
}
67+
3168
/**
3269
* @return returns an {@link IdLoader} instance the loads the _id from stored field.
3370
*/

0 commit comments

Comments
 (0)