Skip to content

Commit 12d7728

Browse files
Merge remote-tracking branch 'origin/main' into lucene_snapshot
2 parents b9418bd + dd9b343 commit 12d7728

File tree

209 files changed

+1783
-3986
lines changed

Some content is hidden

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

209 files changed

+1783
-3986
lines changed

.github/CODEOWNERS

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
# For more info, see https://help.github.com/articles/about-codeowners/
44

55
# Stack Monitoring index templates
6-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-alerts-7.json @elastic/infra-monitoring-ui
7-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-beats-mb.json @elastic/infra-monitoring-ui
8-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-beats.json @elastic/infra-monitoring-ui
9-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-ent-search-mb.json @elastic/infra-monitoring-ui
10-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-es-mb.json @elastic/infra-monitoring-ui
11-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-es.json @elastic/infra-monitoring-ui
12-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-kibana-mb.json @elastic/infra-monitoring-ui
13-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-kibana.json @elastic/infra-monitoring-ui
14-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-logstash-mb.json @elastic/infra-monitoring-ui
15-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-logstash.json @elastic/infra-monitoring-ui
16-
x-pack/plugin/core/template-resources/src/main/resources/monitoring-mb-ilm-policy.json @elastic/infra-monitoring-ui
17-
x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java @elastic/infra-monitoring-ui
6+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-alerts-7.json @elastic/stack-monitoring
7+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-beats-mb.json @elastic/stack-monitoring
8+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-beats.json @elastic/stack-monitoring
9+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-ent-search-mb.json @elastic/stack-monitoring
10+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-es-mb.json @elastic/stack-monitoring
11+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-es.json @elastic/stack-monitoring
12+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-kibana-mb.json @elastic/stack-monitoring
13+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-kibana.json @elastic/stack-monitoring
14+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-logstash-mb.json @elastic/stack-monitoring
15+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-logstash.json @elastic/stack-monitoring
16+
x-pack/plugin/core/template-resources/src/main/resources/monitoring-mb-ilm-policy.json @elastic/stack-monitoring
17+
x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java @elastic/stack-monitoring
1818

1919
# Fleet
2020
x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet @elastic/fleet

docs/changelog/104730.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 104730
2+
summary: "[Profiling] Support downsampling of generic events"
3+
area: Application
4+
type: enhancement
5+
issues: []

docs/changelog/104787.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 104787
2+
summary: Add troubleshooting docs link to `PeerFinder` logs
3+
area: Cluster Coordination
4+
type: enhancement
5+
issues: []

docs/changelog/104808.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 104808
2+
summary: Fix lost headers with chunked responses
3+
area: Network
4+
type: bug
5+
issues: []

docs/reference/esql/functions/date-time-functions.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
// tag::date_list[]
1111
* <<esql-auto_bucket>>
12+
* <<esql-date_diff>>
1213
* <<esql-date_extract>>
1314
* <<esql-date_format>>
1415
* <<esql-date_parse>>
@@ -17,6 +18,7 @@
1718
// end::date_list[]
1819

1920
include::auto_bucket.asciidoc[]
21+
include::date_diff.asciidoc[]
2022
include::date_extract.asciidoc[]
2123
include::date_format.asciidoc[]
2224
include::date_parse.asciidoc[]

docs/reference/esql/functions/date_diff.asciidoc

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
[discrete]
22
[[esql-date_diff]]
33
=== `DATE_DIFF`
4-
Subtract the second argument from the third argument and return their difference in multiples of the unit specified in the first argument.
5-
If the second argument (start) is greater than the third argument (end), then negative values are returned.
64

7-
[cols="^,^"]
5+
*Syntax*
6+
7+
[.text-center]
8+
image::esql/functions/signature/date_diff.svg[Embedded,opts=inline]
9+
10+
*Parameters*
11+
12+
`unit`::
13+
Time difference unit.
14+
15+
`startTimestamp`::
16+
Start timestamp.
17+
18+
`endTimestamp`::
19+
End timestamp.
20+
21+
*Description*
22+
23+
Subtracts the `startTimestamp` from the `endTimestamp` and returns the
24+
difference in multiples of `unit`. If `startTimestamp` is later than the
25+
`endTimestamp`, negative values are returned.
26+
27+
[cols="^,^",role="styled"]
828
|===
929
2+h|Datetime difference units
1030

@@ -26,12 +46,18 @@ s|abbreviations
2646
| nanosecond | nanoseconds, ns
2747
|===
2848

49+
*Supported types*
50+
51+
include::types/date_diff.asciidoc[]
52+
53+
*Example*
54+
2955
[source.merge.styled,esql]
3056
----
31-
include::{esql-specs}/docs.csv-spec[tag=dateDiff]
57+
include::{esql-specs}/date.csv-spec[tag=docsDateDiff]
3258
----
3359
[%header.monospaced.styled,format=dsv,separator=|]
3460
|===
35-
include::{esql-specs}/docs.csv-spec[tag=dateDiff-result]
61+
include::{esql-specs}/date.csv-spec[tag=docsDateDiff-result]
3662
|===
3763

docs/reference/modules/cluster/allocation_awareness.asciidoc

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,32 @@ enable forced awareness.
7575
[[forced-awareness]]
7676
===== Forced awareness
7777

78-
By default, if one location fails, Elasticsearch assigns all of the missing
79-
replica shards to the remaining locations. While you might have sufficient
80-
resources across all locations to host your primary and replica shards, a single
81-
location might be unable to host *ALL* of the shards.
78+
By default, if one location fails, {es} spreads its shards across the remaining
79+
locations. This might be undesirable if the cluster does not have sufficient
80+
resources to host all its shards when one location is missing.
8281

83-
To prevent a single location from being overloaded in the event of a failure,
84-
you can set `cluster.routing.allocation.awareness.force` so no replicas are
85-
allocated until nodes are available in another location.
82+
To prevent the remaining locations from being overloaded in the event of a
83+
whole-location failure, specify the attribute values that should exist with the
84+
`cluster.routing.allocation.awareness.force.*` settings. This will mean that
85+
{es} will prefer to leave some replicas unassigned in the event of a
86+
whole-location failure instead of overloading the nodes in the remaining
87+
locations.
8688

87-
For example, if you have an awareness attribute called `zone` and configure nodes
88-
in `zone1` and `zone2`, you can use forced awareness to prevent Elasticsearch
89-
from allocating replicas if only one zone is available:
89+
For example, if you have an awareness attribute called `zone` and configure
90+
nodes in `zone1` and `zone2`, you can use forced awareness to make {es} leave
91+
half of your shard copies unassigned if only one zone is available:
9092

9193
[source,yaml]
9294
-------------------------------------------------------------------
9395
cluster.routing.allocation.awareness.attributes: zone
9496
cluster.routing.allocation.awareness.force.zone.values: zone1,zone2 <1>
9597
-------------------------------------------------------------------
96-
<1> Specify all possible values for the awareness attribute.
97-
98-
With this example configuration, if you start two nodes with `node.attr.zone` set
99-
to `zone1` and create an index with 5 shards and 1 replica, Elasticsearch creates
100-
the index and allocates the 5 primary shards but no replicas. Replicas are
101-
only allocated once nodes with `node.attr.zone` set to `zone2` are available.
98+
<1> Specify all possible `zone` attribute values.
99+
100+
With this example configuration, if you have two nodes with `node.attr.zone`
101+
set to `zone1` and an index with `number_of_replicas` set to `1`, {es}
102+
allocates all the primary shards but none of the replicas. It will assign the
103+
replica shards once nodes with a different value for `node.attr.zone` join the
104+
cluster. In contrast, if you do not configure forced awareness, {es} will
105+
allocate all primaries and replicas to the two nodes even though they are in
106+
the same zone.

modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/AggregationMultiBucketAggregationTestCase.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,10 @@
99
package org.elasticsearch.aggregations.bucket;
1010

1111
import org.elasticsearch.aggregations.AggregationsPlugin;
12-
import org.elasticsearch.common.util.CollectionUtils;
1312
import org.elasticsearch.plugins.SearchPlugin;
14-
import org.elasticsearch.search.aggregations.Aggregation;
1513
import org.elasticsearch.search.aggregations.InternalAggregation;
1614
import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation;
1715
import org.elasticsearch.test.InternalMultiBucketAggregationTestCase;
18-
import org.elasticsearch.xcontent.ContextParser;
19-
import org.elasticsearch.xcontent.NamedXContentRegistry;
20-
import org.elasticsearch.xcontent.ParseField;
21-
22-
import java.util.List;
23-
import java.util.Map;
2416

2517
/**
2618
* Base class for unit testing multi bucket aggregation's bucket implementations that reside in aggregations module.
@@ -35,15 +27,4 @@ protected SearchPlugin registerPlugin() {
3527
return new AggregationsPlugin();
3628
}
3729

38-
@Override
39-
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
40-
var entry = getParser();
41-
return CollectionUtils.appendToCopy(
42-
getDefaultNamedXContents(),
43-
new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(entry.getKey()), entry.getValue())
44-
);
45-
}
46-
47-
protected abstract Map.Entry<String, ContextParser<Object, Aggregation>> getParser();
48-
4930
}

modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/adjacency/InternalAdjacencyMatrixTests.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
import org.elasticsearch.aggregations.bucket.AggregationMultiBucketAggregationTestCase;
1212
import org.elasticsearch.common.util.Maps;
13-
import org.elasticsearch.search.aggregations.Aggregation;
1413
import org.elasticsearch.search.aggregations.InternalAggregations;
15-
import org.elasticsearch.xcontent.ContextParser;
1614

1715
import java.util.ArrayList;
1816
import java.util.HashMap;
@@ -22,11 +20,6 @@
2220

2321
public class InternalAdjacencyMatrixTests extends AggregationMultiBucketAggregationTestCase<InternalAdjacencyMatrix> {
2422

25-
@Override
26-
protected Map.Entry<String, ContextParser<Object, Aggregation>> getParser() {
27-
return Map.entry(AdjacencyMatrixAggregationBuilder.NAME, (p, c) -> ParsedAdjacencyMatrix.fromXContent(p, (String) c));
28-
}
29-
3023
private List<String> keys;
3124

3225
@Override
@@ -94,11 +87,6 @@ protected void assertReduced(InternalAdjacencyMatrix reduced, List<InternalAdjac
9487
assertEquals(expectedCounts, actualCounts);
9588
}
9689

97-
@Override
98-
protected Class<ParsedAdjacencyMatrix> implementationClass() {
99-
return ParsedAdjacencyMatrix.class;
100-
}
101-
10290
@Override
10391
protected InternalAdjacencyMatrix mutateInstance(InternalAdjacencyMatrix instance) {
10492
String name = instance.getName();

modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogramTests.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@
2121
import org.elasticsearch.common.util.Maps;
2222
import org.elasticsearch.index.mapper.DateFieldMapper;
2323
import org.elasticsearch.search.DocValueFormat;
24-
import org.elasticsearch.search.aggregations.Aggregation;
2524
import org.elasticsearch.search.aggregations.AggregationBuilder;
2625
import org.elasticsearch.search.aggregations.InternalAggregation;
2726
import org.elasticsearch.search.aggregations.InternalAggregations;
2827
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
2928
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
3029
import org.elasticsearch.test.TransportVersionUtils;
31-
import org.elasticsearch.xcontent.ContextParser;
3230

3331
import java.io.IOException;
3432
import java.time.Instant;
@@ -55,11 +53,6 @@
5553

5654
public class InternalAutoDateHistogramTests extends AggregationMultiBucketAggregationTestCase<InternalAutoDateHistogram> {
5755

58-
@Override
59-
protected Map.Entry<String, ContextParser<Object, Aggregation>> getParser() {
60-
return Map.entry(AutoDateHistogramAggregationBuilder.NAME, (p, c) -> ParsedAutoDateHistogram.fromXContent(p, (String) c));
61-
}
62-
6356
protected InternalAutoDateHistogram createTestInstance(
6457
String name,
6558
Map<String, Object> metadata,
@@ -274,11 +267,6 @@ private int getBucketCount(long min, long max, Rounding.Prepared prepared, int i
274267
return bucketCount;
275268
}
276269

277-
@Override
278-
protected Class<ParsedAutoDateHistogram> implementationClass() {
279-
return ParsedAutoDateHistogram.class;
280-
}
281-
282270
@Override
283271
protected InternalAutoDateHistogram mutateInstance(InternalAutoDateHistogram instance) {
284272
String name = instance.getName();

modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/timeseries/InternalTimeSeriesTests.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
import org.elasticsearch.common.util.MockPageCacheRecycler;
1717
import org.elasticsearch.index.mapper.TimeSeriesIdFieldMapper;
1818
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
19-
import org.elasticsearch.search.aggregations.Aggregation;
2019
import org.elasticsearch.search.aggregations.AggregationReduceContext;
2120
import org.elasticsearch.search.aggregations.InternalAggregations;
2221
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
23-
import org.elasticsearch.xcontent.ContextParser;
2422

2523
import java.io.IOException;
2624
import java.io.UncheckedIOException;
@@ -30,18 +28,12 @@
3028
import java.util.List;
3129
import java.util.Map;
3230
import java.util.TreeMap;
33-
import java.util.function.Predicate;
3431

3532
import static org.hamcrest.Matchers.arrayContainingInAnyOrder;
3633
import static org.hamcrest.Matchers.equalTo;
3734

3835
public class InternalTimeSeriesTests extends AggregationMultiBucketAggregationTestCase<InternalTimeSeries> {
3936

40-
@Override
41-
protected Map.Entry<String, ContextParser<Object, Aggregation>> getParser() {
42-
return Map.entry(TimeSeriesAggregationBuilder.NAME, (p, c) -> ParsedTimeSeries.fromXContent(p, (String) c));
43-
}
44-
4537
private List<InternalBucket> randomBuckets(boolean keyed, InternalAggregations aggregations) {
4638
int numberOfBuckets = randomNumberOfBuckets();
4739
List<InternalBucket> bucketList = new ArrayList<>(numberOfBuckets);
@@ -108,16 +100,6 @@ protected void assertReduced(InternalTimeSeries reduced, List<InternalTimeSeries
108100
);
109101
}
110102

111-
@Override
112-
protected Class<ParsedTimeSeries> implementationClass() {
113-
return ParsedTimeSeries.class;
114-
}
115-
116-
@Override
117-
protected Predicate<String> excludePathsFromXContentInsertion() {
118-
return s -> s.endsWith(".key");
119-
}
120-
121103
public void testReduceSimple() {
122104
// a simple test, to easily spot easy mistakes in the merge logic in InternalTimeSeries#reduce(...) method.
123105
InternalTimeSeries first = new InternalTimeSeries(

0 commit comments

Comments
 (0)