Skip to content

Commit 8c524aa

Browse files
authored
Deprecation check renamed bulk threadpool settings (#36662)
Adds a deprecation check for renamed settings related to bulk threadpool which has been renamed to write threadpool.
1 parent 8679fdb commit 8c524aa

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-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
@@ -41,6 +41,7 @@ private DeprecationChecks() {
4141
NodeDeprecationChecks::httpEnabledSettingRemoved,
4242
NodeDeprecationChecks::auditLogPrefixSettingsCheck,
4343
NodeDeprecationChecks::indexThreadPoolCheck,
44+
NodeDeprecationChecks::bulkThreadPoolCheck,
4445
NodeDeprecationChecks::tribeNodeCheck,
4546
NodeDeprecationChecks::httpPipeliningCheck,
4647
NodeDeprecationChecks::discoveryConfigurationCheck,

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ static DeprecationIssue indexThreadPoolCheck(List<NodeInfo> nodeInfos, List<Node
6868
}
6969
return null;
7070
}
71+
static DeprecationIssue bulkThreadPoolCheck(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
72+
List<String> nodesFound = nodeInfos.stream()
73+
.filter(nodeInfo -> nodeInfo.getSettings().getByPrefix("thread_pool.bulk.").isEmpty() == false)
74+
.map(nodeInfo -> nodeInfo.getNode().getName())
75+
.collect(Collectors.toList());
76+
if (nodesFound.size() > 0) {
77+
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
78+
"Bulk thread pool renamed to write thread pool",
79+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
80+
"#write-thread-pool-fallback",
81+
"nodes with bulk thread pool settings: " + nodesFound);
82+
}
83+
return null;
84+
}
7185

7286
static DeprecationIssue tribeNodeCheck(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
7387
List<String> nodesFound = nodeInfos.stream()

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
@@ -94,6 +94,16 @@ public void testIndexThreadPoolCheck() {
9494
assertSettingsAndIssue("thread_pool.index.queue_size", Integer.toString(randomIntBetween(1, 20000)), expected);
9595
}
9696

97+
public void testBulkThreadPoolCheck() {
98+
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
99+
"Bulk thread pool renamed to write thread pool",
100+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
101+
"#write-thread-pool-fallback",
102+
"nodes with bulk thread pool settings: [node_check]");
103+
assertSettingsAndIssue("thread_pool.bulk.size", Integer.toString(randomIntBetween(1, 20000)), expected);
104+
assertSettingsAndIssue("thread_pool.bulk.queue_size", Integer.toString(randomIntBetween(1, 20000)), expected);
105+
}
106+
97107
public void testTribeNodeCheck() {
98108
String tribeSetting = "tribe." + randomAlphaOfLengthBetween(1, 20) + ".cluster.name";
99109
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,

0 commit comments

Comments
 (0)