Skip to content

Commit 0a6d9ec

Browse files
authored
Deprecation check for HTTP pipelining (#36521)
Adds a deprecation check for the removed HTTP pipelining toggle.
1 parent 81720d4 commit 0a6d9ec

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
@@ -40,6 +40,7 @@ private DeprecationChecks() {
4040
Collections.unmodifiableList(Arrays.asList(
4141
NodeDeprecationChecks::httpEnabledSettingRemoved,
4242
NodeDeprecationChecks::tribeNodeCheck,
43+
NodeDeprecationChecks::httpPipeliningCheck,
4344
NodeDeprecationChecks::azureRepositoryChanges,
4445
NodeDeprecationChecks::gcsRepositoryChanges,
4546
NodeDeprecationChecks::fileDiscoveryPluginRemoved

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
1010
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
1111
import org.elasticsearch.common.network.NetworkModule;
12+
import org.elasticsearch.http.HttpTransportSettings;
1213
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1314

1415
import java.util.List;
@@ -49,6 +50,21 @@ static DeprecationIssue tribeNodeCheck(List<NodeInfo> nodeInfos, List<NodeStats>
4950
return null;
5051
}
5152

53+
static DeprecationIssue httpPipeliningCheck(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
54+
List<String> nodesFound = nodeInfos.stream()
55+
.filter(nodeInfo -> nodeInfo.getSettings().hasValue(HttpTransportSettings.SETTING_PIPELINING.getKey()))
56+
.map(nodeInfo -> nodeInfo.getNode().getName())
57+
.collect(Collectors.toList());
58+
if (nodesFound.size() > 0) {
59+
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
60+
"HTTP pipelining setting removed as pipelining is now mandatory",
61+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
62+
"#remove-http-pipelining-setting",
63+
"nodes with http.pipelining set: " + nodesFound);
64+
}
65+
return null;
66+
}
67+
5268
static DeprecationIssue azureRepositoryChanges(List<NodeInfo> nodeInfos, List<NodeStats> nodeStats) {
5369
List<String> nodesFound = nodeInfos.stream()
5470
.filter(nodeInfo ->

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ public void testTribeNodeCheck() {
7878
assertSettingsAndIssue(tribeSetting, randomAlphaOfLength(5), expected);
7979
}
8080

81+
public void testHttpPipeliningCheck() {
82+
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
83+
"HTTP pipelining setting removed as pipelining is now mandatory",
84+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" +
85+
"#remove-http-pipelining-setting",
86+
"nodes with http.pipelining set: [node_check]");
87+
assertSettingsAndIssue("http.pipelining", Boolean.toString(randomBoolean()), expected);
88+
}
89+
8190
public void testAzurePluginCheck() {
8291
Version esVersion = VersionUtils.randomVersionBetween(random(), Version.V_6_0_0, Version.CURRENT);
8392
PluginInfo deprecatedPlugin = new PluginInfo(

0 commit comments

Comments
 (0)