Skip to content

Commit e2ac064

Browse files
committed
Merge branch 'main' of github.com:elastic/elasticsearch into esql_namedqueries
2 parents fa34213 + 7e4d96e commit e2ac064

File tree

12 files changed

+180
-11
lines changed

12 files changed

+180
-11
lines changed

build-tools/src/integTest/groovy/org/elasticsearch/gradle/test/TestBuildInfoPluginFuncTest.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import com.fasterxml.jackson.databind.ObjectMapper
55
import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest
66
import org.gradle.testkit.runner.TaskOutcome
77

8+
import java.nio.file.Path
9+
810
class TestBuildInfoPluginFuncTest extends AbstractGradleFuncTest {
911
def "works"() {
1012
given:
@@ -52,7 +54,7 @@ class TestBuildInfoPluginFuncTest extends AbstractGradleFuncTest {
5254

5355
def location = Map.of(
5456
"module", "com.example",
55-
"representative_class", "com/example/Example.class"
57+
"representative_class", Path.of("com", "example", "Example.class").toString()
5658
)
5759
def expectedOutput = Map.of(
5860
"component", "example-component",

docs/changelog/128298.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 128298
2+
summary: Better handling of node ids from shutdown metadata (avoid NPE on already removed nodes)
3+
area: Infra/Node Lifecycle
4+
type: bug
5+
issues:
6+
- 100201

docs/reference/elasticsearch/mapping-reference/object.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ JSON documents are hierarchical in nature: the document may contain inner object
1111

1212
```console
1313
PUT my-index-000001/_doc/1
14-
{ <1>
14+
{ // <1>
1515
"region": "US",
1616
"manager": { <2>
1717
"age": 30,

docs/reference/search-connectors/es-connectors-sharepoint-online.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To get started, first log in to SharePoint Online and access your administrative
4949

5050
Follow these steps:
5151

52-
* Sign in to [https://portal.azure.com/](https://portal.azure.com/) and click on **Azure Active Directory**.
52+
* Sign in to [https://portal.azure.com/](https://portal.azure.com/) and click on **Microsoft Entra ID** (formerly Azure Active Directory).
5353
* Locate **App Registrations** and Click **New Registration**.
5454
* Give your app a name - like "Search".
5555
* Leave the **Redirect URIs** blank for now.
@@ -133,9 +133,9 @@ Refer to the following documentation for setting [SharePoint permissions](https:
133133
134134
#### Granting `Sites.Selected` permissions [es-connectors-sharepoint-online-sites-selected-permissions-self-managed]
135135
136-
To configure `Sites.Selected` permissions, follow these steps in the Azure Active Directory portal. These permissions enable precise access control to specific SharePoint sites.
136+
To configure `Sites.Selected` permissions, follow these steps in the Microsoft Entra ID (formerly Azure Active Directory) portal. These permissions enable precise access control to specific SharePoint sites.
137137
138-
1. Sign in to the [Azure Active Directory portal](https://portal.azure.com/).
138+
1. Sign in to the [Microsoft Entra ID (formerly Azure Active Directory) portal](https://portal.azure.com/).
139139
2. Navigate to **App registrations** and locate the application created for the connector.
140140
3. Under **API permissions**, click **Add permission**.
141141
4. Select **Microsoft Graph** > **Application permissions**, then add `Sites.Selected`.
@@ -603,4 +603,4 @@ See [Troubleshooting](/reference/search-connectors/es-connectors-troubleshooting
603603

604604
### Security [es-connectors-sharepoint-online-client-security]
605605

606-
See [Security](/reference/search-connectors/es-connectors-security.md).
606+
See [Security](/reference/search-connectors/es-connectors-security.md).

docs/release-notes/breaking-changes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ If you are migrating from a version prior to version 9.0, you must first upgrade
1212

1313
% ## Next version [elasticsearch-nextversion-breaking-changes]
1414

15+
```{applies_to}
16+
stack: coming 9.0.2
17+
```
18+
## 9.0.2 [elasticsearch-9.0.2-breaking-changes]
19+
20+
Snapshot/Restore:
21+
* Make S3 custom query parameter optional [#128043](https://github.com/elastic/elasticsearch/pull/128043)
22+
23+
24+
1525
## 9.0.1 [elasticsearch-9.0.1-breaking-changes]
1626

1727
No breaking changes in this version.

docs/release-notes/deprecations.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ To give you insight into what deprecated features you’re using, {{es}}:
1616

1717
% ## Next version [elasticsearch-nextversion-deprecations]
1818

19+
```{applies_to}
20+
stack: coming 9.0.2
21+
```
22+
## 9.0.2 [elasticsearch-9.0.2-deprecations]
23+
24+
No deprecations in this version.
25+
1926
## 9.0.1 [elasticsearch-9.0.1-deprecations]
2027

2128
No deprecations in this version.

docs/release-notes/index.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,68 @@ To check for security updates, go to [Security announcements for the Elastic sta
2020
% ### Fixes [elasticsearch-next-fixes]
2121
% *
2222

23+
```{applies_to}
24+
stack: coming 9.0.2
25+
```
26+
## 9.0.2 [elasticsearch-9.0.2-release-notes]
27+
28+
### Features and enhancements [elasticsearch-9.0.2-features-enhancements]
29+
30+
Authentication:
31+
* Http proxy support in JWT realm [#127337](https://github.com/elastic/elasticsearch/pull/127337) (issue: [#114956](https://github.com/elastic/elasticsearch/issues/114956))
32+
33+
ES|QL:
34+
* Limit Replace function memory usage [#127924](https://github.com/elastic/elasticsearch/pull/127924)
35+
36+
### Fixes [elasticsearch-9.0.2-fixes]
37+
38+
Aggregations:
39+
* Fix a bug in `significant_terms` [#127975](https://github.com/elastic/elasticsearch/pull/127975)
40+
41+
Audit:
42+
* Handle streaming request body in audit log [#127798](https://github.com/elastic/elasticsearch/pull/127798)
43+
44+
Data streams:
45+
* Fix system data streams incorrectly showing up in the list of template validation problems [#128161](https://github.com/elastic/elasticsearch/pull/128161)
46+
47+
Downsampling:
48+
* Downsampling does not consider passthrough fields as dimensions [#127752](https://github.com/elastic/elasticsearch/pull/127752) (issue: [#125156](https://github.com/elastic/elasticsearch/issues/125156))
49+
50+
ES|QL:
51+
* Don't push down filters on the right hand side of an inlinejoin [#127383](https://github.com/elastic/elasticsearch/pull/127383)
52+
* ESQL: Avoid unintended attribute removal [#127563](https://github.com/elastic/elasticsearch/pull/127563) (issue: [#127468](https://github.com/elastic/elasticsearch/issues/127468))
53+
* ESQL: Fix alias removal in regex extraction with JOIN [#127687](https://github.com/elastic/elasticsearch/pull/127687) (issue: [#127467](https://github.com/elastic/elasticsearch/issues/127467))
54+
* ESQL: Keep `DROP` attributes when resolving field names [#127009](https://github.com/elastic/elasticsearch/pull/127009) (issue: [#126418](https://github.com/elastic/elasticsearch/issues/126418))
55+
* Ensure ordinal builder emit ordinal blocks [#127949](https://github.com/elastic/elasticsearch/pull/127949)
56+
* Fix union types in CCS [#128111](https://github.com/elastic/elasticsearch/pull/128111)
57+
58+
Infra/Core:
59+
* Add missing `outbound_network` entitlement to x-pack-core [#126992](https://github.com/elastic/elasticsearch/pull/126992) (issue: [#127003](https://github.com/elastic/elasticsearch/issues/127003))
60+
* Check hidden frames in entitlements [#127877](https://github.com/elastic/elasticsearch/pull/127877)
61+
62+
Infra/Scripting:
63+
* Avoid nested docs in painless execute api [#127991](https://github.com/elastic/elasticsearch/pull/127991) (issue: [#41004](https://github.com/elastic/elasticsearch/issues/41004))
64+
65+
Machine Learning:
66+
* Append all data to Chat Completion buffer [#127658](https://github.com/elastic/elasticsearch/pull/127658)
67+
* Fix services API Google Vertex AI Rerank location field requirement [#127856](https://github.com/elastic/elasticsearch/pull/127856)
68+
69+
Relevance:
70+
* Fix: Add `NamedWriteable` for `RuleQueryRankDoc` [#128153](https://github.com/elastic/elasticsearch/pull/128153) (issue: [#126071](https://github.com/elastic/elasticsearch/issues/126071))
71+
72+
Security:
73+
* Remove dangling spaces wherever found [#127475](https://github.com/elastic/elasticsearch/pull/127475)
74+
75+
Snapshot/Restore:
76+
* Add missing entitlement to `repository-azure` [#128047](https://github.com/elastic/elasticsearch/pull/128047) (issue: [#128046](https://github.com/elastic/elasticsearch/issues/128046))
77+
78+
TSDB:
79+
* Skip the validation when retrieving the index mode during reindexing a time series data stream [#127824](https://github.com/elastic/elasticsearch/pull/127824)
80+
81+
Vector Search:
82+
* [9.x] Revert "Enable madvise by default for all builds" [#127921](https://github.com/elastic/elasticsearch/pull/127921)
83+
84+
2385
## 9.0.1 [elasticsearch-9.0.1-release-notes]
2486

2587
### Features and enhancements [elasticsearch-9.0.1-features-enhancements]

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ tests:
474474
- class: org.elasticsearch.packaging.test.TemporaryDirectoryConfigTests
475475
method: test21AcceptsCustomPathInDocker
476476
issue: https://github.com/elastic/elasticsearch/issues/128114
477+
- class: org.elasticsearch.reservedstate.service.FileSettingsServiceIT
478+
method: testSymlinkUpdateTriggerReload
479+
issue: https://github.com/elastic/elasticsearch/issues/128369
477480

478481
# Examples:
479482
#

server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import java.util.HashSet;
5050
import java.util.List;
5151
import java.util.Map;
52-
import java.util.Objects;
5352
import java.util.Set;
5453
import java.util.concurrent.atomic.AtomicBoolean;
5554
import java.util.concurrent.atomic.AtomicLong;
@@ -376,9 +375,12 @@ public void onNewInfo(ClusterInfo info) {
376375
}
377376

378377
// Generate a map of node name to ID so we can use it to look up node replacement targets
379-
final Map<String, String> nodeNameToId = state.getRoutingNodes()
378+
final Map<String, List<String>> nodeNameToIds = state.getRoutingNodes()
380379
.stream()
381-
.collect(Collectors.toMap(rn -> rn.node().getName(), RoutingNode::nodeId, (s1, s2) -> s2));
380+
.collect(Collectors.groupingBy(rn -> rn.node().getName(), Collectors.mapping(RoutingNode::nodeId, Collectors.toList())));
381+
382+
// Generate a set of the valid node IDs so we can use it to filter valid sources
383+
final Set<String> routingNodeIds = state.getRoutingNodes().stream().map(RoutingNode::nodeId).collect(Collectors.toSet());
382384

383385
// Calculate both the source node id and the target node id of a "replace" type shutdown
384386
final Set<String> nodesIdsPartOfReplacement = state.metadata()
@@ -387,8 +389,8 @@ public void onNewInfo(ClusterInfo info) {
387389
.values()
388390
.stream()
389391
.filter(meta -> meta.getType() == SingleNodeShutdownMetadata.Type.REPLACE)
390-
.flatMap(meta -> Stream.of(meta.getNodeId(), nodeNameToId.get(meta.getTargetNodeName())))
391-
.filter(Objects::nonNull) // The REPLACE target node might not still be in RoutingNodes
392+
.flatMap(meta -> Stream.concat(Stream.of(meta.getNodeId()), nodeIdsOrEmpty(meta, nodeNameToIds)))
393+
.filter(routingNodeIds::contains) // The REPLACE source node might already have been removed from RoutingNodes
392394
.collect(Collectors.toSet());
393395

394396
// Generate a set of all the indices that exist on either the target or source of a node replacement
@@ -437,6 +439,11 @@ public void onNewInfo(ClusterInfo info) {
437439
}
438440
}
439441

442+
private static Stream<String> nodeIdsOrEmpty(SingleNodeShutdownMetadata meta, Map<String, List<String>> nodeNameToIds) {
443+
var ids = nodeNameToIds.get(meta.getTargetNodeName()); // The REPLACE target node might not still be in RoutingNodes
444+
return ids == null ? Stream.empty() : ids.stream();
445+
}
446+
440447
// exposed for tests to override
441448
long sizeOfRelocatingShards(RoutingNode routingNode, DiskUsage diskUsage, ClusterInfo info, ClusterState reroutedClusterState) {
442449
return DiskThresholdDecider.sizeOfUnaccountedShards(

server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitorTests.java

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,76 @@ public void testSkipDiskThresholdMonitorWhenStateNotRecovered() {
14091409
assertNull(result2.v2());
14101410
}
14111411

1412+
private void doTestSkipNodesNotInRoutingTable(boolean sourceNodeInTable, boolean targetNodeInTable) {
1413+
final var projectId = randomProjectIdOrDefault();
1414+
final Metadata.Builder metadataBuilder = Metadata.builder()
1415+
.put(
1416+
ProjectMetadata.builder(projectId)
1417+
.put(IndexMetadata.builder("test").settings(settings(IndexVersion.current())).numberOfShards(1).numberOfReplicas(1))
1418+
.build()
1419+
);
1420+
1421+
metadataBuilder.putCustom(
1422+
NodesShutdownMetadata.TYPE,
1423+
new NodesShutdownMetadata(
1424+
Collections.singletonMap(
1425+
"node1",
1426+
SingleNodeShutdownMetadata.builder()
1427+
.setNodeId("node1")
1428+
.setNodeEphemeralId("node1")
1429+
.setReason("testing")
1430+
.setType(SingleNodeShutdownMetadata.Type.REPLACE)
1431+
.setTargetNodeName("node3")
1432+
.setStartedAtMillis(randomNonNegativeLong())
1433+
.build()
1434+
)
1435+
)
1436+
);
1437+
1438+
final Metadata metadata = metadataBuilder.build();
1439+
final RoutingTable routingTable = RoutingTable.builder(TestShardRoutingRoleStrategies.DEFAULT_ROLE_ONLY)
1440+
.addAsNew(metadata.getProject(projectId).index("test"))
1441+
.build();
1442+
DiscoveryNodes.Builder discoveryNodes = DiscoveryNodes.builder().add(newNormalNode("node2", "node2"));
1443+
// node1 which is replaced by node3 may or may not be in the cluster
1444+
if (sourceNodeInTable) {
1445+
discoveryNodes.add(newNormalNode("node1", "node1"));
1446+
}
1447+
// node3 which is to replace node1 may or may not be in the cluster
1448+
if (targetNodeInTable) {
1449+
discoveryNodes.add(newNormalNode("node3", "node3"));
1450+
}
1451+
final ClusterState clusterState = applyStartedShardsUntilNoChange(
1452+
ClusterState.builder(ClusterName.DEFAULT)
1453+
.metadata(metadata)
1454+
.routingTable(GlobalRoutingTable.builder().put(projectId, routingTable).build())
1455+
.nodes(discoveryNodes)
1456+
.build(),
1457+
createAllocationService(Settings.EMPTY)
1458+
);
1459+
final Index testIndex = routingTable.index("test").getIndex();
1460+
1461+
Map<String, DiskUsage> diskUsages = new HashMap<>();
1462+
diskUsages.put("node1", new DiskUsage("node1", "node1", "/foo/bar", 100, between(0, 4)));
1463+
diskUsages.put("node2", new DiskUsage("node2", "node2", "/foo/bar", 100, between(0, 4)));
1464+
final ClusterInfo clusterInfo = clusterInfo(diskUsages);
1465+
Tuple<Boolean, Set<Index>> result = runDiskThresholdMonitor(clusterState, clusterInfo);
1466+
assertTrue(result.v1()); // reroute on new nodes
1467+
assertThat(result.v2(), contains(testIndex));
1468+
}
1469+
1470+
public void testSkipReplaceSourceNodeNotInRoutingTable() {
1471+
doTestSkipNodesNotInRoutingTable(false, true);
1472+
}
1473+
1474+
public void testSkipReplaceTargetNodeNotInRoutingTable() {
1475+
doTestSkipNodesNotInRoutingTable(true, false);
1476+
}
1477+
1478+
public void testSkipReplaceSourceAndTargetNodesNotInRoutingTable() {
1479+
doTestSkipNodesNotInRoutingTable(false, false);
1480+
}
1481+
14121482
// Runs a disk threshold monitor with a given cluster state and cluster info and returns whether a reroute should
14131483
// happen and any indices that should be marked as read-only.
14141484
private Tuple<Boolean, Set<Index>> runDiskThresholdMonitor(ClusterState clusterState, ClusterInfo clusterInfo) {

0 commit comments

Comments
 (0)