Skip to content

Commit 50a3dfa

Browse files
authored
Deprecation check for tribe node (#36240)
Adds a deprecation check for tribe node.
1 parent 5149d3b commit 50a3dfa

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ private DeprecationChecks() {
3838

3939
static List<BiFunction<List<NodeInfo>, List<NodeStats>, DeprecationIssue>> NODE_SETTINGS_CHECKS =
4040
Collections.unmodifiableList(Arrays.asList(
41+
NodeDeprecationChecks::tribeNodeCheck,
4142
NodeDeprecationChecks::azureRepositoryChanges,
4243
NodeDeprecationChecks::gcsRepositoryChanges,
4344
NodeDeprecationChecks::fileDiscoveryPluginRemoved

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@
1818
*/
1919
public class NodeDeprecationChecks {
2020

21+
static DeprecationIssue tribeNodeCheck(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
22+
List<String> nodesFound = nodeInfos.stream()
23+
.filter(nodeInfo -> nodeInfo.getSettings().getByPrefix("tribe.").isEmpty() == false)
24+
.map(nodeInfo -> nodeInfo.getNode().getName())
25+
.collect(Collectors.toList());
26+
if (nodesFound.size() > 0) {
27+
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
28+
"Tribe Node removed in favor of Cross Cluster Search",
29+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
30+
"#_tribe_node_removed",
31+
"nodes with tribe node settings: " + nodesFound);
32+
}
33+
return null;
34+
}
35+
2136
static DeprecationIssue azureRepositoryChanges(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
2237
List<String> nodesFound = nodeInfos.stream()
2338
.filter(nodeInfo ->

x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ null, null, null, null, new FsInfo(0L, null, paths), null, null, null,
5959
assertEquals(singletonList(expected), issues);
6060
}
6161

62+
public void testTribeNodeCheck() {
63+
String tribeSetting = "tribe." + randomAlphaOfLengthBetween(1, 20) + ".cluster.name";
64+
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
65+
"Tribe Node removed in favor of Cross Cluster Search",
66+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
67+
"#_tribe_node_removed",
68+
"nodes with tribe node settings: [node_check]");
69+
assertSettingsAndIssue(tribeSetting, randomAlphaOfLength(5), expected);
70+
}
71+
6272
public void testAzurePluginCheck() {
6373
Version esVersion = VersionUtils.randomVersionBetween(random(), Version.V_6_0_0, Version.CURRENT);
6474
PluginInfo deprecatedPlugin = new PluginInfo(

0 commit comments

Comments
 (0)