Skip to content

Commit ad3b7ab

Browse files
authored
Deprecate old transport settings (#41229)
This is related to #36652. We intend to remove a number of old transport settings in 8.0. This commit deprecates those settings for 7.x.
1 parent 750db02 commit ad3b7ab

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

server/src/main/java/org/elasticsearch/common/network/NetworkService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ public final class NetworkService {
5858
Setting.byteSizeSetting("network.tcp.send_buffer_size", new ByteSizeValue(-1), Property.NodeScope);
5959
public static final Setting<ByteSizeValue> TCP_RECEIVE_BUFFER_SIZE =
6060
Setting.byteSizeSetting("network.tcp.receive_buffer_size", new ByteSizeValue(-1), Property.NodeScope);
61-
// TODO: Deprecate in 7.0
6261
public static final Setting<TimeValue> TCP_CONNECT_TIMEOUT =
63-
Setting.timeSetting("network.tcp.connect_timeout", new TimeValue(30, TimeUnit.SECONDS), Property.NodeScope);
62+
Setting.timeSetting("network.tcp.connect_timeout", new TimeValue(30, TimeUnit.SECONDS), Property.NodeScope,
63+
Setting.Property.Deprecated);
6464

6565
/**
6666
* A custom name resolver can support custom lookup keys (my_net_key:ipv4) and also change

server/src/main/java/org/elasticsearch/http/HttpTransportSettings.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ public final class HttpTransportSettings {
107107

108108
// Tcp socket settings
109109

110-
// TODO: Deprecate in 7.0
111110
public static final Setting<Boolean> OLD_SETTING_HTTP_TCP_NO_DELAY =
112-
boolSetting("http.tcp_no_delay", NetworkService.TCP_NO_DELAY, Setting.Property.NodeScope);
111+
boolSetting("http.tcp_no_delay", NetworkService.TCP_NO_DELAY, Setting.Property.NodeScope, Setting.Property.Deprecated);
113112
public static final Setting<Boolean> SETTING_HTTP_TCP_NO_DELAY =
114113
boolSetting("http.tcp.no_delay", OLD_SETTING_HTTP_TCP_NO_DELAY, Setting.Property.NodeScope);
115114
public static final Setting<Boolean> SETTING_HTTP_TCP_KEEP_ALIVE =

server/src/main/java/org/elasticsearch/transport/TransportSettings.java

+13-18
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ public final class TransportSettings {
5252
listSetting("transport.bind_host", HOST, Function.identity(), Setting.Property.NodeScope);
5353
public static final Setting.AffixSetting<List<String>> BIND_HOST_PROFILE = affixKeySetting("transport.profiles.", "bind_host",
5454
key -> listSetting(key, BIND_HOST, Function.identity(), Setting.Property.NodeScope));
55-
// TODO: Deprecate in 7.0
5655
public static final Setting<String> OLD_PORT =
57-
new Setting<>("transport.tcp.port", "9300-9400", Function.identity(), Setting.Property.NodeScope);
56+
new Setting<>("transport.tcp.port", "9300-9400", Function.identity(), Setting.Property.NodeScope, Setting.Property.Deprecated);
5857
public static final Setting<String> PORT =
5958
new Setting<>("transport.port", OLD_PORT, Function.identity(), Setting.Property.NodeScope);
6059
public static final Setting.AffixSetting<String> PORT_PROFILE = affixKeySetting("transport.profiles.", "port",
@@ -63,73 +62,69 @@ public final class TransportSettings {
6362
intSetting("transport.publish_port", -1, -1, Setting.Property.NodeScope);
6463
public static final Setting.AffixSetting<Integer> PUBLISH_PORT_PROFILE = affixKeySetting("transport.profiles.", "publish_port",
6564
key -> intSetting(key, -1, -1, Setting.Property.NodeScope));
66-
// TODO: Deprecate in 7.0
6765
public static final Setting<Boolean> OLD_TRANSPORT_COMPRESS =
68-
boolSetting("transport.tcp.compress", false, Setting.Property.NodeScope);
66+
boolSetting("transport.tcp.compress", false, Setting.Property.NodeScope, Setting.Property.Deprecated);
6967
public static final Setting<Boolean> TRANSPORT_COMPRESS =
7068
boolSetting("transport.compress", OLD_TRANSPORT_COMPRESS, Setting.Property.NodeScope);
7169
// the scheduled internal ping interval setting, defaults to disabled (-1)
7270
public static final Setting<TimeValue> PING_SCHEDULE =
7371
timeSetting("transport.ping_schedule", TimeValue.timeValueSeconds(-1), Setting.Property.NodeScope);
74-
// TODO: Deprecate in 7.0
7572
public static final Setting<TimeValue> TCP_CONNECT_TIMEOUT =
76-
timeSetting("transport.tcp.connect_timeout", NetworkService.TCP_CONNECT_TIMEOUT, Setting.Property.NodeScope);
73+
timeSetting("transport.tcp.connect_timeout", NetworkService.TCP_CONNECT_TIMEOUT, Setting.Property.NodeScope,
74+
Setting.Property.Deprecated);
7775
public static final Setting<TimeValue> CONNECT_TIMEOUT =
7876
timeSetting("transport.connect_timeout", TCP_CONNECT_TIMEOUT, Setting.Property.NodeScope);
7977
public static final Setting<Settings> DEFAULT_FEATURES_SETTING = Setting.groupSetting(FEATURE_PREFIX + ".", Setting.Property.NodeScope);
8078

8179
// Tcp socket settings
8280

83-
// TODO: Deprecate in 7.0
8481
public static final Setting<Boolean> OLD_TCP_NO_DELAY =
85-
boolSetting("transport.tcp_no_delay", NetworkService.TCP_NO_DELAY, Setting.Property.NodeScope);
82+
boolSetting("transport.tcp_no_delay", NetworkService.TCP_NO_DELAY, Setting.Property.NodeScope, Setting.Property.Deprecated);
8683
public static final Setting<Boolean> TCP_NO_DELAY =
8784
boolSetting("transport.tcp.no_delay", OLD_TCP_NO_DELAY, Setting.Property.NodeScope);
88-
// TODO: Deprecate in 7.0
8985
public static final Setting.AffixSetting<Boolean> OLD_TCP_NO_DELAY_PROFILE =
90-
affixKeySetting("transport.profiles.", "tcp_no_delay", key -> boolSetting(key, TCP_NO_DELAY, Setting.Property.NodeScope));
86+
affixKeySetting("transport.profiles.", "tcp_no_delay", key -> boolSetting(key, TCP_NO_DELAY, Setting.Property.NodeScope,
87+
Setting.Property.Deprecated));
9188
public static final Setting.AffixSetting<Boolean> TCP_NO_DELAY_PROFILE =
9289
affixKeySetting("transport.profiles.", "tcp.no_delay",
9390
key -> boolSetting(key,
9491
fallback(key, OLD_TCP_NO_DELAY_PROFILE, "tcp\\.no_delay$", "tcp_no_delay"),
9592
Setting.Property.NodeScope));
9693
public static final Setting<Boolean> TCP_KEEP_ALIVE =
9794
boolSetting("transport.tcp.keep_alive", NetworkService.TCP_KEEP_ALIVE, Setting.Property.NodeScope);
98-
// TODO: Deprecate in 7.0
9995
public static final Setting.AffixSetting<Boolean> OLD_TCP_KEEP_ALIVE_PROFILE =
100-
affixKeySetting("transport.profiles.", "tcp_keep_alive", key -> boolSetting(key, TCP_KEEP_ALIVE, Setting.Property.NodeScope));
96+
affixKeySetting("transport.profiles.", "tcp_keep_alive",
97+
key -> boolSetting(key, TCP_KEEP_ALIVE, Setting.Property.NodeScope, Setting.Property.Deprecated));
10198
public static final Setting.AffixSetting<Boolean> TCP_KEEP_ALIVE_PROFILE =
10299
affixKeySetting("transport.profiles.", "tcp.keep_alive",
103100
key -> boolSetting(key,
104101
fallback(key, OLD_TCP_KEEP_ALIVE_PROFILE, "tcp\\.keep_alive$", "tcp_keep_alive"),
105102
Setting.Property.NodeScope));
106103
public static final Setting<Boolean> TCP_REUSE_ADDRESS =
107104
boolSetting("transport.tcp.reuse_address", NetworkService.TCP_REUSE_ADDRESS, Setting.Property.NodeScope);
108-
// TODO: Deprecate in 7.0
109105
public static final Setting.AffixSetting<Boolean> OLD_TCP_REUSE_ADDRESS_PROFILE =
110-
affixKeySetting("transport.profiles.", "reuse_address", key -> boolSetting(key, TCP_REUSE_ADDRESS, Setting.Property.NodeScope));
106+
affixKeySetting("transport.profiles.", "reuse_address", key -> boolSetting(key, TCP_REUSE_ADDRESS, Setting.Property.NodeScope,
107+
Setting.Property.Deprecated));
111108
public static final Setting.AffixSetting<Boolean> TCP_REUSE_ADDRESS_PROFILE =
112109
affixKeySetting("transport.profiles.", "tcp.reuse_address",
113110
key -> boolSetting(key,
114111
fallback(key, OLD_TCP_REUSE_ADDRESS_PROFILE, "tcp\\.reuse_address$", "reuse_address"),
115112
Setting.Property.NodeScope));
116113
public static final Setting<ByteSizeValue> TCP_SEND_BUFFER_SIZE =
117114
Setting.byteSizeSetting("transport.tcp.send_buffer_size", NetworkService.TCP_SEND_BUFFER_SIZE, Setting.Property.NodeScope);
118-
// TODO: Deprecate in 7.0
119115
public static final Setting.AffixSetting<ByteSizeValue> OLD_TCP_SEND_BUFFER_SIZE_PROFILE =
120116
affixKeySetting("transport.profiles.", "send_buffer_size",
121-
key -> Setting.byteSizeSetting(key, TCP_SEND_BUFFER_SIZE, Setting.Property.NodeScope));
117+
key -> Setting.byteSizeSetting(key, TCP_SEND_BUFFER_SIZE, Setting.Property.NodeScope, Setting.Property.Deprecated));
122118
public static final Setting.AffixSetting<ByteSizeValue> TCP_SEND_BUFFER_SIZE_PROFILE =
123119
affixKeySetting("transport.profiles.", "tcp.send_buffer_size",
124120
key -> Setting.byteSizeSetting(key,
125121
fallback(key, OLD_TCP_SEND_BUFFER_SIZE_PROFILE, "tcp\\.send_buffer_size$", "send_buffer_size"),
126122
Setting.Property.NodeScope));
127123
public static final Setting<ByteSizeValue> TCP_RECEIVE_BUFFER_SIZE =
128124
Setting.byteSizeSetting("transport.tcp.receive_buffer_size", NetworkService.TCP_RECEIVE_BUFFER_SIZE, Setting.Property.NodeScope);
129-
// TODO: Deprecate in 7.0
130125
public static final Setting.AffixSetting<ByteSizeValue> OLD_TCP_RECEIVE_BUFFER_SIZE_PROFILE =
131126
affixKeySetting("transport.profiles.", "receive_buffer_size",
132-
key -> Setting.byteSizeSetting(key, TCP_RECEIVE_BUFFER_SIZE, Setting.Property.NodeScope));
127+
key -> Setting.byteSizeSetting(key, TCP_RECEIVE_BUFFER_SIZE, Setting.Property.NodeScope, Setting.Property.Deprecated));
133128
public static final Setting.AffixSetting<ByteSizeValue> TCP_RECEIVE_BUFFER_SIZE_PROFILE =
134129
affixKeySetting("transport.profiles.", "tcp.receive_buffer_size",
135130
key -> Setting.byteSizeSetting(key,

test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2585,7 +2585,7 @@ public void testProfileSettings() {
25852585
Settings defaultProfileSettings = Settings.builder()
25862586
.put("transport.profiles.default.tcp.no_delay", enable)
25872587
.put("transport.profiles.default.tcp.keep_alive", enable)
2588-
.put("transport.profiles.default.reuse_address", enable)
2588+
.put("transport.profiles.default.tcp.reuse_address", enable)
25892589
.put("transport.profiles.default.tcp.send_buffer_size", "43000b")
25902590
.put("transport.profiles.default.tcp.receive_buffer_size", "42000b")
25912591
.put("transport.profiles.default.port", "9700-9800")
@@ -2598,7 +2598,7 @@ public void testProfileSettings() {
25982598
Settings profileSettings = Settings.builder()
25992599
.put("transport.profiles.some_profile.tcp.no_delay", enable)
26002600
.put("transport.profiles.some_profile.tcp.keep_alive", enable)
2601-
.put("transport.profiles.some_profile.reuse_address", enable)
2601+
.put("transport.profiles.some_profile.tcp.reuse_address", enable)
26022602
.put("transport.profiles.some_profile.tcp.send_buffer_size", "43000b")
26032603
.put("transport.profiles.some_profile.tcp.receive_buffer_size", "42000b")
26042604
.put("transport.profiles.some_profile.port", "9700-9800")

0 commit comments

Comments
 (0)