Skip to content

Commit

Permalink
Deprecation check renamed bulk threadpool settings (#36662)
Browse files Browse the repository at this point in the history
Adds a deprecation check for renamed settings related to bulk threadpool
which has been renamed to write threadpool.
  • Loading branch information
gwbrown authored Dec 18, 2018
1 parent 8679fdb commit 8c524aa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private DeprecationChecks() {
NodeDeprecationChecks::httpEnabledSettingRemoved,
NodeDeprecationChecks::auditLogPrefixSettingsCheck,
NodeDeprecationChecks::indexThreadPoolCheck,
NodeDeprecationChecks::bulkThreadPoolCheck,
NodeDeprecationChecks::tribeNodeCheck,
NodeDeprecationChecks::httpPipeliningCheck,
NodeDeprecationChecks::discoveryConfigurationCheck,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ static DeprecationIssue indexThreadPoolCheck(List<NodeInfo> nodeInfos, List<Node
}
return null;
}
static DeprecationIssue bulkThreadPoolCheck(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
List<String> nodesFound = nodeInfos.stream()
.filter(nodeInfo -> nodeInfo.getSettings().getByPrefix("thread_pool.bulk.").isEmpty() == false)
.map(nodeInfo -> nodeInfo.getNode().getName())
.collect(Collectors.toList());
if (nodesFound.size() > 0) {
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
"Bulk thread pool renamed to write thread pool",
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
"#write-thread-pool-fallback",
"nodes with bulk thread pool settings: " + nodesFound);
}
return null;
}

static DeprecationIssue tribeNodeCheck(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
List<String> nodesFound = nodeInfos.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ public void testIndexThreadPoolCheck() {
assertSettingsAndIssue("thread_pool.index.queue_size", Integer.toString(randomIntBetween(1, 20000)), expected);
}

public void testBulkThreadPoolCheck() {
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
"Bulk thread pool renamed to write thread pool",
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
"#write-thread-pool-fallback",
"nodes with bulk thread pool settings: [node_check]");
assertSettingsAndIssue("thread_pool.bulk.size", Integer.toString(randomIntBetween(1, 20000)), expected);
assertSettingsAndIssue("thread_pool.bulk.queue_size", Integer.toString(randomIntBetween(1, 20000)), expected);
}

public void testTribeNodeCheck() {
String tribeSetting = "tribe." + randomAlphaOfLengthBetween(1, 20) + ".cluster.name";
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
Expand Down

0 comments on commit 8c524aa

Please sign in to comment.