Skip to content

Commit 35504ee

Browse files
committed
Merge remote-tracking branch 'es/main' into logsdb_rolling_upgrade_tests_in_serverless
2 parents 4db8d82 + b4d23a9 commit 35504ee

File tree

82 files changed

+1181
-569
lines changed

Some content is hidden

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

82 files changed

+1181
-569
lines changed

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/SystemJvmOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, St
6262
"-Dio.netty.recycler.maxCapacityPerThread=0",
6363
// Needed to get access to raw vectors from Lucene scorers
6464
"--add-opens=org.apache.lucene.core/org.apache.lucene.codecs.lucene99=org.elasticsearch.server",
65+
"--add-opens=org.apache.lucene.core/org.apache.lucene.codecs.hnsw=org.elasticsearch.server",
6566
"--add-opens=org.apache.lucene.core/org.apache.lucene.internal.vectorization=org.elasticsearch.server",
6667
// log4j 2
6768
"-Dlog4j.shutdownHookEnabled=false",

docs/changelog/134709.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 134709
2+
summary: "OTLP: store units in mappings"
3+
area: Mapping
4+
type: enhancement
5+
issues: []

docs/changelog/138559.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138559
2+
summary: Accept `project_routing` as query parameter
3+
area: EQL
4+
type: enhancement
5+
issues: []

docs/changelog/138568.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138568
2+
summary: Use doc values skipper for `_tsid` in synthetic `_id` postings
3+
area: TSDB
4+
type: enhancement
5+
issues: []

docs/changelog/138718.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138718
2+
summary: Add `project_routing` option
3+
area: SQL
4+
type: enhancement
5+
issues: []

libs/gpu-codec/src/main/java/org/elasticsearch/gpu/codec/ES92GpuHnswVectorsWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ private void mergeByteVectorField(
620620
}
621621
}
622622
} else {
623-
logger.warn("Cannot get merged raw vectors from scorer.");
623+
logger.warn("Cannot get merged raw vectors from scorer. Performances will be degraded.");
624624
var byteVectorValues = getMergedByteVectorValues(fieldInfo, mergeState);
625625

626626
// TODO: revert to CuVSMatrix.deviceBuilder when cuvs has fixed the multiple copies problem

server/src/internalClusterTest/java/org/elasticsearch/action/bulk/IncrementalBulkIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void testIncrementalBulkHighWatermarkBackOff() throws Exception {
203203
AtomicBoolean nextPage = new AtomicBoolean(false);
204204

205205
ArrayList<IncrementalBulkService.Handler> handlers = new ArrayList<>();
206-
for (int i = 0; i < 4; ++i) {
206+
for (int i = 0; i < 5; ++i) {
207207
ArrayList<DocWriteRequest<?>> requests = new ArrayList<>();
208208
add512BRequests(requests, index);
209209
IncrementalBulkService.Handler handler = incrementalBulkService.newBulkRequest();
@@ -230,6 +230,8 @@ public void testIncrementalBulkHighWatermarkBackOff() throws Exception {
230230
// Test that a request larger than SPLIT_BULK_HIGH_WATERMARK_SIZE (1KB) is throttled
231231
add512BRequests(requestsThrottle, index);
232232
add512BRequests(requestsThrottle, index);
233+
// Ensure we'll be above SPLIT_BULK_HIGH_WATERMARK
234+
assertThat(indexingPressure.stats().getCurrentCombinedCoordinatingAndPrimaryBytes() + 1024, greaterThan(4096L));
233235

234236
CountDownLatch finishLatch = new CountDownLatch(1);
235237
blockWriteCoordinationPool(threadPool, finishLatch);

server/src/internalClusterTest/java/org/elasticsearch/monitor/metrics/NodeIndexingMetricsIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ public void testIncrementalBulkHighWatermarkSplitMetrics() throws Exception {
796796
AtomicBoolean nextPage = new AtomicBoolean(false);
797797

798798
ArrayList<IncrementalBulkService.Handler> handlers = new ArrayList<>();
799-
for (int i = 0; i < 4; ++i) {
799+
for (int i = 0; i < 5; ++i) {
800800
ArrayList<DocWriteRequest<?>> requests = new ArrayList<>();
801801
add512BRequests(requests, index);
802802
IncrementalBulkService.Handler handler = incrementalBulkService.newBulkRequest();
@@ -838,6 +838,8 @@ public void testIncrementalBulkHighWatermarkSplitMetrics() throws Exception {
838838
// Test that a request larger than SPLIT_BULK_HIGH_WATERMARK_SIZE (1KB) is throttled
839839
add512BRequests(requestsThrottle, index);
840840
add512BRequests(requestsThrottle, index);
841+
// Ensure we'll be above SPLIT_BULK_HIGH_WATERMARK
842+
assertThat(indexingPressure.stats().getCurrentCombinedCoordinatingAndPrimaryBytes() + 1024, greaterThan(4096L));
841843

842844
CountDownLatch finishLatch = new CountDownLatch(1);
843845
blockWriteCoordinationPool(threadPool, finishLatch);

server/src/main/java/org/elasticsearch/action/bulk/BulkRequestParser.java

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public final class BulkRequestParser {
6868
private static final ParseField REQUIRE_DATA_STREAM = new ParseField(DocWriteRequest.REQUIRE_DATA_STREAM);
6969
private static final ParseField LIST_EXECUTED_PIPELINES = new ParseField(DocWriteRequest.LIST_EXECUTED_PIPELINES);
7070
private static final ParseField DYNAMIC_TEMPLATES = new ParseField("dynamic_templates");
71+
private static final ParseField DYNAMIC_TEMPLATE_PARAMS = new ParseField("dynamic_template_params");
7172

7273
// TODO: Remove this parameter once the BulkMonitoring endpoint has been removed
7374
// for CompatibleApi V7 this means to deprecate on type, for V8+ it means to throw an error
@@ -359,6 +360,7 @@ private boolean parseActionLine(BytesReference data, int from, int to) throws IO
359360
boolean requireAlias = defaultRequireAlias != null && defaultRequireAlias;
360361
boolean requireDataStream = defaultRequireDataStream != null && defaultRequireDataStream;
361362
Map<String, String> dynamicTemplates = Map.of();
363+
Map<String, Map<String, String>> dynamicTemplatesParms = Map.of();
362364

363365
// at this stage, next token can either be END_OBJECT (and use default index and type, with auto generated id)
364366
// or START_OBJECT which will have another set of parameters
@@ -427,19 +429,22 @@ private boolean parseActionLine(BytesReference data, int from, int to) throws IO
427429
&& DYNAMIC_TEMPLATES.match(currentFieldName, parser.getDeprecationHandler())) {
428430
dynamicTemplates = parser.mapStrings();
429431
} else if (token == XContentParser.Token.START_OBJECT
430-
&& SOURCE.match(currentFieldName, parser.getDeprecationHandler())) {
431-
currentFetchSourceContext = FetchSourceContext.fromXContent(parser);
432-
} else if (token != XContentParser.Token.VALUE_NULL) {
433-
throw new IllegalArgumentException(
434-
"Malformed action/metadata line ["
435-
+ line
436-
+ "], expected a simple value for field ["
437-
+ currentFieldName
438-
+ "] but found ["
439-
+ token
440-
+ "]"
441-
);
442-
}
432+
&& DYNAMIC_TEMPLATE_PARAMS.match(currentFieldName, parser.getDeprecationHandler())) {
433+
dynamicTemplatesParms = parser.map(HashMap::new, XContentParser::mapStrings);
434+
} else if (token == XContentParser.Token.START_OBJECT
435+
&& SOURCE.match(currentFieldName, parser.getDeprecationHandler())) {
436+
currentFetchSourceContext = FetchSourceContext.fromXContent(parser);
437+
} else if (token != XContentParser.Token.VALUE_NULL) {
438+
throw new IllegalArgumentException(
439+
"Malformed action/metadata line ["
440+
+ line
441+
+ "], expected a simple value for field ["
442+
+ currentFieldName
443+
+ "] but found ["
444+
+ token
445+
+ "]"
446+
);
447+
}
443448
}
444449
} else if (token != XContentParser.Token.END_OBJECT) {
445450
throw new IllegalArgumentException(
@@ -462,6 +467,11 @@ private boolean parseActionLine(BytesReference data, int from, int to) throws IO
462467
"Delete request in line [" + line + "] does not accept " + DYNAMIC_TEMPLATES.getPreferredName()
463468
);
464469
}
470+
if (dynamicTemplatesParms.isEmpty() == false) {
471+
throw new IllegalArgumentException(
472+
"Update request in line [" + line + "] does not accept " + DYNAMIC_TEMPLATE_PARAMS.getPreferredName()
473+
);
474+
}
465475
currentRequest = new DeleteRequest(index).id(id)
466476
.routing(routing)
467477
.version(version)
@@ -480,6 +490,7 @@ private boolean parseActionLine(BytesReference data, int from, int to) throws IO
480490
.setIfSeqNo(ifSeqNo)
481491
.setIfPrimaryTerm(ifPrimaryTerm)
482492
.setDynamicTemplates(dynamicTemplates)
493+
.setDynamicTemplateParams(dynamicTemplatesParms)
483494
.setRequireAlias(requireAlias)
484495
.setRequireDataStream(requireDataStream)
485496
.setListExecutedPipelines(currentListExecutedPipelines)
@@ -508,6 +519,11 @@ private boolean parseActionLine(BytesReference data, int from, int to) throws IO
508519
"Update request in line [" + line + "] does not accept " + DYNAMIC_TEMPLATES.getPreferredName()
509520
);
510521
}
522+
if (dynamicTemplatesParms.isEmpty() == false) {
523+
throw new IllegalArgumentException(
524+
"Update request in line [" + line + "] does not accept " + DYNAMIC_TEMPLATE_PARAMS.getPreferredName()
525+
);
526+
}
511527
UpdateRequest updateRequest = new UpdateRequest().index(index)
512528
.id(id)
513529
.routing(routing)

server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ static boolean executeBulkItemRequest(
433433
request.getContentType(),
434434
request.routing(),
435435
request.getDynamicTemplates(),
436+
request.getDynamicTemplateParams(),
436437
request.getIncludeSourceOnError(),
437438
meteringParserDecorator,
438439
request.tsid()
@@ -755,6 +756,7 @@ private static Engine.Result performOpOnReplica(
755756
indexRequest.getContentType(),
756757
indexRequest.routing(),
757758
Map.of(),
759+
Map.of(),
758760
true,
759761
XContentMeteringParserDecorator.NOOP,
760762
indexRequest.tsid()

0 commit comments

Comments
 (0)