Skip to content

Commit 8cf1bf9

Browse files
author
elasticsearchmachine
committed
Merge remote-tracking branch 'origin/main' into lucene_snapshot
2 parents cfa3cda + 291ced7 commit 8cf1bf9

File tree

167 files changed

+4019
-1662
lines changed

Some content is hidden

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

167 files changed

+4019
-1662
lines changed

docs/changelog/114951.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 114951
2+
summary: Expose cluster-state role mappings in APIs
3+
area: Authentication
4+
type: bug
5+
issues: []

docs/changelog/115102.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 115102
2+
summary: Watch Next Run Interval Resets On Shard Move or Node Restart
3+
area: Watcher
4+
type: bug
5+
issues:
6+
- 111433

docs/changelog/115317.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 115317
2+
summary: Revert "Add `ResolvedExpression` wrapper"
3+
area: Indices APIs
4+
type: bug
5+
issues: []

docs/changelog/115359.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 115359
2+
summary: Adding support for simulate ingest mapping adddition for indices with mappings
3+
that do not come from templates
4+
area: Ingest Node
5+
type: enhancement
6+
issues: []

docs/reference/esql/functions/kibana/definition/to_date_nanos.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/watcher/how-watcher-works.asciidoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,18 @@ add, the more distributed the watches can be executed. If you add or remove
146146
replicas, all watches need to be reloaded. If a shard is relocated, the
147147
primary and all replicas of this particular shard will reload.
148148

149-
Because the watches are executed on the node, where the watch shards are, you can create
150-
dedicated watcher nodes by using shard allocation filtering.
149+
Because the watches are executed on the node, where the watch shards are, you
150+
can create dedicated watcher nodes by using shard allocation filtering. To do this
151+
, configure nodes with a dedicated `node.attr.role: watcher` property.
151152

152-
You could configure nodes with a dedicated `node.attr.role: watcher` property and
153-
then configure the `.watches` index like this:
153+
As the `.watches` index is a system index, you can't use the normal `.watcher/_settings`
154+
endpoint to modify its routing allocation. Instead, you can use the following dedicated
155+
endpoint to adjust the allocation of the `.watches` shards to the nodes with the
156+
`watcher` role attribute:
154157

155158
[source,console]
156159
------------------------
157-
PUT .watches/_settings
160+
PUT _watcher/settings
158161
{
159162
"index.routing.allocation.include.role": "watcher"
160163
}

modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTaskExecutor.java

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343
import org.elasticsearch.threadpool.ThreadPool;
4444
import org.elasticsearch.transport.RemoteTransportException;
4545

46+
import java.util.Collections;
47+
import java.util.HashSet;
4648
import java.util.List;
4749
import java.util.Map;
4850
import java.util.Objects;
4951
import java.util.Set;
5052
import java.util.concurrent.atomic.AtomicBoolean;
5153
import java.util.concurrent.atomic.AtomicReference;
52-
import java.util.stream.Collectors;
5354

5455
import static org.elasticsearch.ingest.geoip.GeoIpDownloader.DATABASES_INDEX;
5556
import static org.elasticsearch.ingest.geoip.GeoIpDownloader.GEOIP_DOWNLOADER;
@@ -238,14 +239,11 @@ public void clusterChanged(ClusterChangedEvent event) {
238239
}
239240

240241
static boolean hasAtLeastOneGeoipProcessor(ClusterState clusterState) {
241-
if (pipelineConfigurationsWithGeoIpProcessor(clusterState, true).isEmpty() == false) {
242+
if (pipelinesWithGeoIpProcessor(clusterState, true).isEmpty() == false) {
242243
return true;
243244
}
244245

245-
Set<String> checkReferencedPipelines = pipelineConfigurationsWithGeoIpProcessor(clusterState, false).stream()
246-
.map(PipelineConfiguration::getId)
247-
.collect(Collectors.toSet());
248-
246+
final Set<String> checkReferencedPipelines = pipelinesWithGeoIpProcessor(clusterState, false);
249247
if (checkReferencedPipelines.isEmpty()) {
250248
return false;
251249
}
@@ -258,22 +256,24 @@ static boolean hasAtLeastOneGeoipProcessor(ClusterState clusterState) {
258256
}
259257

260258
/**
261-
* Retrieve list of pipelines that have at least one geoip processor.
259+
* Retrieve the set of pipeline ids that have at least one geoip processor.
262260
* @param clusterState Cluster state.
263261
* @param downloadDatabaseOnPipelineCreation Filter the list to include only pipeline with the download_database_on_pipeline_creation
264262
* matching the param.
265-
* @return A list of {@link PipelineConfiguration} matching criteria.
263+
* @return A set of pipeline ids matching criteria.
266264
*/
267265
@SuppressWarnings("unchecked")
268-
private static List<PipelineConfiguration> pipelineConfigurationsWithGeoIpProcessor(
269-
ClusterState clusterState,
270-
boolean downloadDatabaseOnPipelineCreation
271-
) {
272-
List<PipelineConfiguration> pipelineDefinitions = IngestService.getPipelines(clusterState);
273-
return pipelineDefinitions.stream().filter(pipelineConfig -> {
274-
List<Map<String, Object>> processors = (List<Map<String, Object>>) pipelineConfig.getConfigAsMap().get(Pipeline.PROCESSORS_KEY);
275-
return hasAtLeastOneGeoipProcessor(processors, downloadDatabaseOnPipelineCreation);
276-
}).toList();
266+
private static Set<String> pipelinesWithGeoIpProcessor(ClusterState clusterState, boolean downloadDatabaseOnPipelineCreation) {
267+
List<PipelineConfiguration> configurations = IngestService.getPipelines(clusterState);
268+
Set<String> ids = new HashSet<>();
269+
// note: this loop is unrolled rather than streaming-style because it's hot enough to show up in a flamegraph
270+
for (PipelineConfiguration configuration : configurations) {
271+
List<Map<String, Object>> processors = (List<Map<String, Object>>) configuration.getConfigAsMap().get(Pipeline.PROCESSORS_KEY);
272+
if (hasAtLeastOneGeoipProcessor(processors, downloadDatabaseOnPipelineCreation)) {
273+
ids.add(configuration.getId());
274+
}
275+
}
276+
return Collections.unmodifiableSet(ids);
277277
}
278278

279279
/**
@@ -283,7 +283,15 @@ private static List<PipelineConfiguration> pipelineConfigurationsWithGeoIpProces
283283
* @return true if a geoip processor is found in the processor list.
284284
*/
285285
private static boolean hasAtLeastOneGeoipProcessor(List<Map<String, Object>> processors, boolean downloadDatabaseOnPipelineCreation) {
286-
return processors != null && processors.stream().anyMatch(p -> hasAtLeastOneGeoipProcessor(p, downloadDatabaseOnPipelineCreation));
286+
if (processors != null) {
287+
// note: this loop is unrolled rather than streaming-style because it's hot enough to show up in a flamegraph
288+
for (Map<String, Object> processor : processors) {
289+
if (hasAtLeastOneGeoipProcessor(processor, downloadDatabaseOnPipelineCreation)) {
290+
return true;
291+
}
292+
}
293+
}
294+
return false;
287295
}
288296

289297
/**
@@ -317,7 +325,7 @@ private static boolean hasAtLeastOneGeoipProcessor(Map<String, Object> processor
317325
}
318326

319327
/**
320-
* Check if a processor config is has an on_failure clause containing at least a geoip processor.
328+
* Check if a processor config has an on_failure clause containing at least a geoip processor.
321329
* @param processor Processor config.
322330
* @param downloadDatabaseOnPipelineCreation Should the download_database_on_pipeline_creation of the geoip processor be true or false.
323331
* @return true if a geoip processor is found in the processor list.
@@ -327,16 +335,17 @@ private static boolean isProcessorWithOnFailureGeoIpProcessor(
327335
Map<String, Object> processor,
328336
boolean downloadDatabaseOnPipelineCreation
329337
) {
330-
return processor != null
331-
&& processor.values()
332-
.stream()
333-
.anyMatch(
334-
value -> value instanceof Map
335-
&& hasAtLeastOneGeoipProcessor(
336-
((Map<String, List<Map<String, Object>>>) value).get("on_failure"),
337-
downloadDatabaseOnPipelineCreation
338-
)
339-
);
338+
// note: this loop is unrolled rather than streaming-style because it's hot enough to show up in a flamegraph
339+
for (Object value : processor.values()) {
340+
if (value instanceof Map
341+
&& hasAtLeastOneGeoipProcessor(
342+
((Map<String, List<Map<String, Object>>>) value).get("on_failure"),
343+
downloadDatabaseOnPipelineCreation
344+
)) {
345+
return true;
346+
}
347+
}
348+
return false;
340349
}
341350

342351
/**

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@ public BlockLoader blockLoader(BlockLoaderContext blContext) {
364364
SourceValueFetcher fetcher = SourceValueFetcher.toString(blContext.sourcePaths(name()));
365365
// MatchOnlyText never has norms, so we have to use the field names field
366366
BlockSourceReader.LeafIteratorLookup lookup = BlockSourceReader.lookupFromFieldNames(blContext.fieldNames(), name());
367-
var sourceMode = blContext.indexSettings().getIndexMappingSourceMode();
368-
return new BlockSourceReader.BytesRefsBlockLoader(fetcher, lookup, sourceMode);
367+
return new BlockSourceReader.BytesRefsBlockLoader(fetcher, lookup);
369368
}
370369

371370
@Override

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ public BlockLoader blockLoader(BlockLoaderContext blContext) {
319319
BlockSourceReader.LeafIteratorLookup lookup = isStored() || isIndexed()
320320
? BlockSourceReader.lookupFromFieldNames(blContext.fieldNames(), name())
321321
: BlockSourceReader.lookupMatchingAll();
322-
var sourceMode = blContext.indexSettings().getIndexMappingSourceMode();
323-
return new BlockSourceReader.DoublesBlockLoader(valueFetcher, lookup, sourceMode);
322+
return new BlockSourceReader.DoublesBlockLoader(valueFetcher, lookup);
324323
}
325324

326325
@Override

muted-tests.yml

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ tests:
9999
issue: https://github.com/elastic/elasticsearch/issues/112424
100100
- class: org.elasticsearch.ingest.geoip.IngestGeoIpClientYamlTestSuiteIT
101101
issue: https://github.com/elastic/elasticsearch/issues/111497
102-
- class: org.elasticsearch.smoketest.SmokeTestIngestWithAllDepsClientYamlTestSuiteIT
103-
method: test {yaml=ingest/80_ingest_simulate/Test ingest simulate with reroute and mapping validation from templates}
104-
issue: https://github.com/elastic/elasticsearch/issues/112575
105102
- class: org.elasticsearch.xpack.security.authc.kerberos.SimpleKdcLdapServerTests
106103
method: testClientServiceMutualAuthentication
107104
issue: https://github.com/elastic/elasticsearch/issues/112529
@@ -146,18 +143,12 @@ tests:
146143
- class: org.elasticsearch.action.admin.cluster.node.stats.NodeStatsTests
147144
method: testChunking
148145
issue: https://github.com/elastic/elasticsearch/issues/113139
149-
- class: org.elasticsearch.xpack.inference.rest.ServerSentEventsRestActionListenerTests
150-
method: testResponse
151-
issue: https://github.com/elastic/elasticsearch/issues/113148
152146
- class: org.elasticsearch.packaging.test.WindowsServiceTests
153147
method: test30StartStop
154148
issue: https://github.com/elastic/elasticsearch/issues/113160
155149
- class: org.elasticsearch.packaging.test.WindowsServiceTests
156150
method: test33JavaChanged
157151
issue: https://github.com/elastic/elasticsearch/issues/113177
158-
- class: org.elasticsearch.xpack.inference.rest.ServerSentEventsRestActionListenerTests
159-
method: testErrorMidStream
160-
issue: https://github.com/elastic/elasticsearch/issues/113179
161152
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
162153
method: test {categorize.Categorize SYNC}
163154
issue: https://github.com/elastic/elasticsearch/issues/113054
@@ -170,9 +161,6 @@ tests:
170161
- class: org.elasticsearch.packaging.test.WindowsServiceTests
171162
method: test80JavaOptsInEnvVar
172163
issue: https://github.com/elastic/elasticsearch/issues/113219
173-
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.AvgTests
174-
method: "testFold {TestCase=<double> #2}"
175-
issue: https://github.com/elastic/elasticsearch/issues/113225
176164
- class: org.elasticsearch.packaging.test.WindowsServiceTests
177165
method: test81JavaOptsInJvmOptions
178166
issue: https://github.com/elastic/elasticsearch/issues/113313
@@ -212,8 +200,6 @@ tests:
212200
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
213201
method: test {categorize.Categorize SYNC}
214202
issue: https://github.com/elastic/elasticsearch/issues/113722
215-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDateNanosTests
216-
issue: https://github.com/elastic/elasticsearch/issues/113661
217203
- class: org.elasticsearch.ingest.geoip.DatabaseNodeServiceIT
218204
method: testNonGzippedDatabase
219205
issue: https://github.com/elastic/elasticsearch/issues/113821
@@ -244,9 +230,6 @@ tests:
244230
- class: org.elasticsearch.xpack.inference.InferenceCrudIT
245231
method: testGet
246232
issue: https://github.com/elastic/elasticsearch/issues/114135
247-
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.AvgTests
248-
method: "testFold {TestCase=<double> #7}"
249-
issue: https://github.com/elastic/elasticsearch/issues/114175
250233
- class: org.elasticsearch.xpack.ilm.ExplainLifecycleIT
251234
method: testStepInfoPreservedOnAutoRetry
252235
issue: https://github.com/elastic/elasticsearch/issues/114220
@@ -276,15 +259,6 @@ tests:
276259
- class: org.elasticsearch.xpack.inference.DefaultElserIT
277260
method: testInferCreatesDefaultElser
278261
issue: https://github.com/elastic/elasticsearch/issues/114503
279-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
280-
method: test {p0=synonyms/60_synonym_rule_get/Synonym set not found}
281-
issue: https://github.com/elastic/elasticsearch/issues/114432
282-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
283-
method: test {p0=synonyms/60_synonym_rule_get/Get a synonym rule}
284-
issue: https://github.com/elastic/elasticsearch/issues/114443
285-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
286-
method: test {p0=synonyms/60_synonym_rule_get/Synonym rule not found}
287-
issue: https://github.com/elastic/elasticsearch/issues/114444
288262
- class: org.elasticsearch.xpack.inference.integration.ModelRegistryIT
289263
method: testGetModel
290264
issue: https://github.com/elastic/elasticsearch/issues/114657
@@ -308,24 +282,27 @@ tests:
308282
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
309283
method: testInferDeploysDefaultElser
310284
issue: https://github.com/elastic/elasticsearch/issues/114913
311-
- class: org.elasticsearch.upgrades.MultiVersionRepositoryAccessIT
312-
method: testCreateAndRestoreSnapshot
313-
issue: https://github.com/elastic/elasticsearch/issues/114998
314-
- class: org.elasticsearch.index.mapper.TextFieldMapperTests
315-
method: testBlockLoaderFromRowStrideReaderWithSyntheticSource
316-
issue: https://github.com/elastic/elasticsearch/issues/115066
317-
- class: org.elasticsearch.index.mapper.TextFieldMapperTests
318-
method: testBlockLoaderFromColumnReaderWithSyntheticSource
319-
issue: https://github.com/elastic/elasticsearch/issues/115073
320-
- class: org.elasticsearch.index.mapper.annotatedtext.AnnotatedTextFieldMapperTests
321-
method: testBlockLoaderFromColumnReaderWithSyntheticSource
322-
issue: https://github.com/elastic/elasticsearch/issues/115074
323-
- class: org.elasticsearch.index.mapper.annotatedtext.AnnotatedTextFieldMapperTests
324-
method: testBlockLoaderFromRowStrideReaderWithSyntheticSource
325-
issue: https://github.com/elastic/elasticsearch/issues/115076
326285
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
327286
method: test {p0=esql/60_usage/Basic ESQL usage output (telemetry)}
328287
issue: https://github.com/elastic/elasticsearch/issues/115231
288+
- class: org.elasticsearch.xpack.watcher.trigger.schedule.engine.TickerScheduleEngineTests
289+
method: testAddWithNoLastCheckedTimeButHasActivationTimeExecutesBeforeInitialInterval
290+
issue: https://github.com/elastic/elasticsearch/issues/115339
291+
- class: org.elasticsearch.xpack.watcher.trigger.schedule.engine.TickerScheduleEngineTests
292+
method: testWatchWithLastCheckedTimeExecutesBeforeInitialInterval
293+
issue: https://github.com/elastic/elasticsearch/issues/115354
294+
- class: org.elasticsearch.xpack.watcher.trigger.schedule.engine.TickerScheduleEngineTests
295+
method: testAddWithLastCheckedTimeExecutesBeforeInitialInterval
296+
issue: https://github.com/elastic/elasticsearch/issues/115356
297+
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
298+
method: testInferDeploysDefaultE5
299+
issue: https://github.com/elastic/elasticsearch/issues/115361
300+
- class: org.elasticsearch.xpack.watcher.trigger.schedule.engine.TickerScheduleEngineTests
301+
method: testWatchWithNoLastCheckedTimeButHasActivationTimeExecutesBeforeInitialInterval
302+
issue: https://github.com/elastic/elasticsearch/issues/115368
303+
- class: org.elasticsearch.reservedstate.service.FileSettingsServiceTests
304+
method: testProcessFileChanges
305+
issue: https://github.com/elastic/elasticsearch/issues/115280
329306

330307
# Examples:
331308
#

0 commit comments

Comments
 (0)