Skip to content

Commit 5d12c6d

Browse files
authored
Merge branch 'main' into bc-upgrade/bc-commit-hash-script
2 parents 50013e5 + eeace58 commit 5d12c6d

File tree

21 files changed

+203
-98
lines changed

21 files changed

+203
-98
lines changed

docs/changelog/129074.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 129074
2+
summary: "[apm-data] Set `event.dataset` if empty for logs"
3+
area: Data streams
4+
type: bug
5+
issues: []

muted-tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,15 @@ tests:
577577
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceTests
578578
method: testIORateIsAdjustedForAllRunningMergeTasks
579579
issue: https://github.com/elastic/elasticsearch/issues/129531
580+
- class: org.elasticsearch.upgrades.IndexingIT
581+
method: testIndexing
582+
issue: https://github.com/elastic/elasticsearch/issues/129533
583+
- class: org.elasticsearch.upgrades.MlJobSnapshotUpgradeIT
584+
method: testSnapshotUpgrader
585+
issue: https://github.com/elastic/elasticsearch/issues/98560
586+
- class: org.elasticsearch.upgrades.QueryableBuiltInRolesUpgradeIT
587+
method: testBuiltInRolesSyncedOnClusterUpgrade
588+
issue: https://github.com/elastic/elasticsearch/issues/129534
580589

581590
# Examples:
582591
#

server/src/internalClusterTest/java/org/elasticsearch/index/shard/IndexShardIT.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import org.elasticsearch.cluster.ClusterInfoService;
2020
import org.elasticsearch.cluster.ClusterInfoServiceUtils;
2121
import org.elasticsearch.cluster.ClusterState;
22+
import org.elasticsearch.cluster.EstimatedHeapUsage;
23+
import org.elasticsearch.cluster.EstimatedHeapUsageCollector;
2224
import org.elasticsearch.cluster.InternalClusterInfoService;
23-
import org.elasticsearch.cluster.ShardHeapUsage;
24-
import org.elasticsearch.cluster.ShardHeapUsageCollector;
2525
import org.elasticsearch.cluster.metadata.IndexMetadata;
2626
import org.elasticsearch.cluster.node.DiscoveryNode;
2727
import org.elasticsearch.cluster.node.DiscoveryNodeUtils;
@@ -123,7 +123,7 @@ public class IndexShardIT extends ESSingleNodeTestCase {
123123

124124
@Override
125125
protected Collection<Class<? extends Plugin>> getPlugins() {
126-
return pluginList(InternalSettingsPlugin.class, BogusShardHeapUsagePlugin.class);
126+
return pluginList(InternalSettingsPlugin.class, BogusEstimatedHeapUsagePlugin.class);
127127
}
128128

129129
public void testLockTryingToDelete() throws Exception {
@@ -264,31 +264,31 @@ public void testExpectedShardSizeIsPresent() throws InterruptedException {
264264
public void testHeapUsageEstimateIsPresent() {
265265
InternalClusterInfoService clusterInfoService = (InternalClusterInfoService) getInstanceFromNode(ClusterInfoService.class);
266266
ClusterInfoServiceUtils.refresh(clusterInfoService);
267-
Map<String, ShardHeapUsage> shardHeapUsages = clusterInfoService.getClusterInfo().getShardHeapUsages();
268-
assertNotNull(shardHeapUsages);
267+
Map<String, EstimatedHeapUsage> estimatedHeapUsages = clusterInfoService.getClusterInfo().getEstimatedHeapUsages();
268+
assertNotNull(estimatedHeapUsages);
269269
// Not collecting yet because it is disabled
270-
assertTrue(shardHeapUsages.isEmpty());
270+
assertTrue(estimatedHeapUsages.isEmpty());
271271

272-
// Enable collection for shard heap usages
272+
// Enable collection for estimated heap usages
273273
updateClusterSettings(
274274
Settings.builder()
275-
.put(InternalClusterInfoService.CLUSTER_ROUTING_ALLOCATION_SHARD_HEAP_THRESHOLD_DECIDER_ENABLED.getKey(), true)
275+
.put(InternalClusterInfoService.CLUSTER_ROUTING_ALLOCATION_ESTIMATED_HEAP_THRESHOLD_DECIDER_ENABLED.getKey(), true)
276276
.build()
277277
);
278278
try {
279279
ClusterInfoServiceUtils.refresh(clusterInfoService);
280280
ClusterState state = getInstanceFromNode(ClusterService.class).state();
281-
shardHeapUsages = clusterInfoService.getClusterInfo().getShardHeapUsages();
282-
assertEquals(state.nodes().size(), shardHeapUsages.size());
281+
estimatedHeapUsages = clusterInfoService.getClusterInfo().getEstimatedHeapUsages();
282+
assertEquals(state.nodes().size(), estimatedHeapUsages.size());
283283
for (DiscoveryNode node : state.nodes()) {
284-
assertTrue(shardHeapUsages.containsKey(node.getId()));
285-
ShardHeapUsage shardHeapUsage = shardHeapUsages.get(node.getId());
286-
assertThat(shardHeapUsage.estimatedFreeBytes(), lessThanOrEqualTo(shardHeapUsage.totalBytes()));
284+
assertTrue(estimatedHeapUsages.containsKey(node.getId()));
285+
EstimatedHeapUsage estimatedHeapUsage = estimatedHeapUsages.get(node.getId());
286+
assertThat(estimatedHeapUsage.estimatedFreeBytes(), lessThanOrEqualTo(estimatedHeapUsage.totalBytes()));
287287
}
288288
} finally {
289289
updateClusterSettings(
290290
Settings.builder()
291-
.putNull(InternalClusterInfoService.CLUSTER_ROUTING_ALLOCATION_SHARD_HEAP_THRESHOLD_DECIDER_ENABLED.getKey())
291+
.putNull(InternalClusterInfoService.CLUSTER_ROUTING_ALLOCATION_ESTIMATED_HEAP_THRESHOLD_DECIDER_ENABLED.getKey())
292292
.build()
293293
);
294294
}
@@ -838,11 +838,11 @@ private static void assertAllIndicesRemovedAndDeletionCompleted(Iterable<Indices
838838
}
839839
}
840840

841-
public static class BogusShardShardHeapUsageCollector implements ShardHeapUsageCollector {
841+
public static class BogusEstimatedEstimatedHeapUsageCollector implements EstimatedHeapUsageCollector {
842842

843-
private final BogusShardHeapUsagePlugin plugin;
843+
private final BogusEstimatedHeapUsagePlugin plugin;
844844

845-
public BogusShardShardHeapUsageCollector(BogusShardHeapUsagePlugin plugin) {
845+
public BogusEstimatedEstimatedHeapUsageCollector(BogusEstimatedHeapUsagePlugin plugin) {
846846
this.plugin = plugin;
847847
}
848848

@@ -859,7 +859,7 @@ public void collectClusterHeapUsage(ActionListener<Map<String, Long>> listener)
859859
}
860860
}
861861

862-
public static class BogusShardHeapUsagePlugin extends Plugin implements ClusterPlugin {
862+
public static class BogusEstimatedHeapUsagePlugin extends Plugin implements ClusterPlugin {
863863

864864
private final SetOnce<ClusterService> clusterService = new SetOnce<>();
865865

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# License v3.0 only", or the "Server Side Public License, v 1".
88
#
99

10-
org.elasticsearch.index.shard.IndexShardIT$BogusShardShardHeapUsageCollector
10+
org.elasticsearch.index.shard.IndexShardIT$BogusEstimatedEstimatedHeapUsageCollector

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class ClusterInfo implements ChunkedToXContent, Writeable {
5757
final Map<ShardId, Long> shardDataSetSizes;
5858
final Map<NodeAndShard, String> dataPath;
5959
final Map<NodeAndPath, ReservedSpace> reservedSpace;
60-
final Map<String, ShardHeapUsage> shardHeapUsages;
60+
final Map<String, EstimatedHeapUsage> estimatedHeapUsages;
6161

6262
protected ClusterInfo() {
6363
this(Map.of(), Map.of(), Map.of(), Map.of(), Map.of(), Map.of(), Map.of());
@@ -72,7 +72,7 @@ protected ClusterInfo() {
7272
* @param shardDataSetSizes a shard id to data set size in bytes mapping per shard
7373
* @param dataPath the shard routing to datapath mapping
7474
* @param reservedSpace reserved space per shard broken down by node and data path
75-
* @param shardHeapUsages shard heap usage broken down by node
75+
* @param estimatedHeapUsages estimated heap usage broken down by node
7676
* @see #shardIdentifierFromRouting
7777
*/
7878
public ClusterInfo(
@@ -82,15 +82,15 @@ public ClusterInfo(
8282
Map<ShardId, Long> shardDataSetSizes,
8383
Map<NodeAndShard, String> dataPath,
8484
Map<NodeAndPath, ReservedSpace> reservedSpace,
85-
Map<String, ShardHeapUsage> shardHeapUsages
85+
Map<String, EstimatedHeapUsage> estimatedHeapUsages
8686
) {
8787
this.leastAvailableSpaceUsage = Map.copyOf(leastAvailableSpaceUsage);
8888
this.mostAvailableSpaceUsage = Map.copyOf(mostAvailableSpaceUsage);
8989
this.shardSizes = Map.copyOf(shardSizes);
9090
this.shardDataSetSizes = Map.copyOf(shardDataSetSizes);
9191
this.dataPath = Map.copyOf(dataPath);
9292
this.reservedSpace = Map.copyOf(reservedSpace);
93-
this.shardHeapUsages = Map.copyOf(shardHeapUsages);
93+
this.estimatedHeapUsages = Map.copyOf(estimatedHeapUsages);
9494
}
9595

9696
public ClusterInfo(StreamInput in) throws IOException {
@@ -103,9 +103,9 @@ public ClusterInfo(StreamInput in) throws IOException {
103103
: in.readImmutableMap(nested -> NodeAndShard.from(new ShardRouting(nested)), StreamInput::readString);
104104
this.reservedSpace = in.readImmutableMap(NodeAndPath::new, ReservedSpace::new);
105105
if (in.getTransportVersion().onOrAfter(TransportVersions.HEAP_USAGE_IN_CLUSTER_INFO)) {
106-
this.shardHeapUsages = in.readImmutableMap(ShardHeapUsage::new);
106+
this.estimatedHeapUsages = in.readImmutableMap(EstimatedHeapUsage::new);
107107
} else {
108-
this.shardHeapUsages = Map.of();
108+
this.estimatedHeapUsages = Map.of();
109109
}
110110
}
111111

@@ -122,7 +122,7 @@ public void writeTo(StreamOutput out) throws IOException {
122122
}
123123
out.writeMap(this.reservedSpace);
124124
if (out.getTransportVersion().onOrAfter(TransportVersions.HEAP_USAGE_IN_CLUSTER_INFO)) {
125-
out.writeMap(this.shardHeapUsages, StreamOutput::writeWriteable);
125+
out.writeMap(this.estimatedHeapUsages, StreamOutput::writeWriteable);
126126
}
127127
}
128128

@@ -204,7 +204,7 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params
204204
return builder.endObject(); // NodeAndPath
205205
}),
206206
endArray() // end "reserved_sizes"
207-
// NOTE: We don't serialize shardHeapUsages at this stage, to avoid
207+
// NOTE: We don't serialize estimatedHeapUsages at this stage, to avoid
208208
// committing to API payloads until the feature is settled
209209
);
210210
}
@@ -216,8 +216,8 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params
216216
* Also note that the map may not be complete, it may contain none, or a subset of the nodes in
217217
* the cluster at any time. It may also contain entries for nodes that have since left the cluster.
218218
*/
219-
public Map<String, ShardHeapUsage> getShardHeapUsages() {
220-
return shardHeapUsages;
219+
public Map<String, EstimatedHeapUsage> getEstimatedHeapUsages() {
220+
return estimatedHeapUsages;
221221
}
222222

223223
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class ClusterInfoSimulator {
3333
private final CopyOnFirstWriteMap<String, Long> shardSizes;
3434
private final Map<ShardId, Long> shardDataSetSizes;
3535
private final Map<NodeAndShard, String> dataPath;
36-
private final Map<String, ShardHeapUsage> shardHeapUsages;
36+
private final Map<String, EstimatedHeapUsage> estimatedHeapUsages;
3737

3838
public ClusterInfoSimulator(RoutingAllocation allocation) {
3939
this.allocation = allocation;
@@ -42,7 +42,7 @@ public ClusterInfoSimulator(RoutingAllocation allocation) {
4242
this.shardSizes = new CopyOnFirstWriteMap<>(allocation.clusterInfo().shardSizes);
4343
this.shardDataSetSizes = Map.copyOf(allocation.clusterInfo().shardDataSetSizes);
4444
this.dataPath = Map.copyOf(allocation.clusterInfo().dataPath);
45-
this.shardHeapUsages = allocation.clusterInfo().getShardHeapUsages();
45+
this.estimatedHeapUsages = allocation.clusterInfo().getEstimatedHeapUsages();
4646
}
4747

4848
/**
@@ -156,7 +156,7 @@ public ClusterInfo getClusterInfo() {
156156
shardDataSetSizes,
157157
dataPath,
158158
Map.of(),
159-
shardHeapUsages
159+
estimatedHeapUsages
160160
);
161161
}
162162
}

server/src/main/java/org/elasticsearch/cluster/ShardHeapUsage.java renamed to server/src/main/java/org/elasticsearch/cluster/EstimatedHeapUsage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
/**
1919
* Record representing an estimate of the heap used by allocated shards and ongoing merges on a particular node
2020
*/
21-
public record ShardHeapUsage(String nodeId, long totalBytes, long estimatedUsageBytes) implements Writeable {
21+
public record EstimatedHeapUsage(String nodeId, long totalBytes, long estimatedUsageBytes) implements Writeable {
2222

23-
public ShardHeapUsage {
23+
public EstimatedHeapUsage {
2424
assert totalBytes >= 0;
2525
assert estimatedUsageBytes >= 0;
2626
}
2727

28-
public ShardHeapUsage(StreamInput in) throws IOException {
28+
public EstimatedHeapUsage(StreamInput in) throws IOException {
2929
this(in.readString(), in.readVLong(), in.readVLong());
3030
}
3131

server/src/main/java/org/elasticsearch/cluster/ShardHeapUsageCollector.java renamed to server/src/main/java/org/elasticsearch/cluster/EstimatedHeapUsageCollector.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
import java.util.Map;
1515

1616
/**
17-
* Collect the shard heap usage for each node in the cluster.
17+
* Collect the estimated heap usage for each node in the cluster.
1818
* <p>
1919
* Results are returned as a map of node ID to estimated heap usage in bytes
2020
*
21-
* @see ShardHeapUsage
21+
* @see EstimatedHeapUsage
2222
*/
23-
public interface ShardHeapUsageCollector {
23+
public interface EstimatedHeapUsageCollector {
2424

2525
/**
26-
* This will be used when there is no ShardHeapUsageCollector available
26+
* This will be used when there is no EstimatedHeapUsageCollector available
2727
*/
28-
ShardHeapUsageCollector EMPTY = listener -> listener.onResponse(Map.of());
28+
EstimatedHeapUsageCollector EMPTY = listener -> listener.onResponse(Map.of());
2929

3030
/**
31-
* Collect the shard heap usage for every node in the cluster
31+
* Collect the estimated heap usage for every node in the cluster
3232
*
3333
* @param listener The listener which will receive the results
3434
*/

0 commit comments

Comments
 (0)