Skip to content

Commit 3b71a31

Browse files
authored
Remove Zen1 (#39466)
Removes all traces of Zen1 from the code base. Some of these commits will also be backported to 7.0/7.x (#39470) as the cluster.coordination package was making use of some things in discovery.zen and we want to keep 7.x as close as possible to master.
1 parent 02b4e80 commit 3b71a31

File tree

86 files changed

+646
-10610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+646
-10610
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,6 @@ class ClusterConfiguration {
6363
@Input
6464
boolean debug = false
6565

66-
/**
67-
* Configuration of the setting {@code discovery.zen.minimum_master_nodes} on the nodes.
68-
* In case of more than one node, this defaults to the number of nodes
69-
*/
70-
@Input
71-
Closure<Integer> minimumMasterNodes = {
72-
if (bwcVersion != null && bwcVersion.before("6.5.0")) {
73-
return numNodes > 1 ? numNodes : -1
74-
} else {
75-
return numNodes > 1 ? numNodes.intdiv(2) + 1 : -1
76-
}
77-
}
78-
7966
/**
8067
* Whether the initial_master_nodes setting should be automatically derived from the nodes
8168
* in the cluster. Only takes effect if all nodes in the cluster understand this setting

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -127,42 +127,25 @@ class ClusterFormationTasks {
127127
nodes.add(node)
128128
Closure<Map> writeConfigSetup
129129
Object dependsOn
130-
if (node.nodeVersion.onOrAfter("6.5.0")) {
131-
writeConfigSetup = { Map esConfig ->
132-
if (config.getAutoSetHostsProvider()) {
133-
// Don't force discovery provider if one is set by the test cluster specs already
134-
final String seedProvidersSettingName =
135-
node.nodeVersion.onOrAfter("7.0.0") ? "discovery.seed_providers" : "discovery.zen.hosts_provider";
136-
if (esConfig.containsKey(seedProvidersSettingName) == false) {
137-
esConfig[seedProvidersSettingName] = 'file'
138-
}
139-
esConfig[node.nodeVersion.onOrAfter("7.0.0") ? "discovery.seed_hosts" : "discovery.zen.ping.unicast.hosts"] = []
140-
}
141-
boolean supportsInitialMasterNodes = hasBwcNodes == false || config.bwcVersion.onOrAfter("7.0.0")
142-
if (esConfig['discovery.type'] == null && config.getAutoSetInitialMasterNodes() && supportsInitialMasterNodes) {
143-
esConfig['cluster.initial_master_nodes'] = nodes.stream().map({ n ->
144-
if (n.config.settings['node.name'] == null) {
145-
return "node-" + n.nodeNum
146-
} else {
147-
return n.config.settings['node.name']
148-
}
149-
}).collect(Collectors.toList())
130+
writeConfigSetup = { Map esConfig ->
131+
if (config.getAutoSetHostsProvider()) {
132+
if (esConfig.containsKey("discovery.seed_providers") == false) {
133+
esConfig["discovery.seed_providers"] = 'file'
150134
}
151-
esConfig
135+
esConfig["discovery.seed_hosts"] = []
152136
}
153-
dependsOn = startDependencies
154-
} else {
155-
dependsOn = startTasks.empty ? startDependencies : startTasks.get(0)
156-
writeConfigSetup = { Map esConfig ->
157-
String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.createAntBuilder())
158-
if (unicastTransportUri == null) {
159-
esConfig['discovery.zen.ping.unicast.hosts'] = []
160-
} else {
161-
esConfig['discovery.zen.ping.unicast.hosts'] = "\"${unicastTransportUri}\""
162-
}
163-
esConfig
137+
if (esConfig['discovery.type'] == null && config.getAutoSetInitialMasterNodes()) {
138+
esConfig['cluster.initial_master_nodes'] = nodes.stream().map({ n ->
139+
if (n.config.settings['node.name'] == null) {
140+
return "node-" + n.nodeNum
141+
} else {
142+
return n.config.settings['node.name']
143+
}
144+
}).collect(Collectors.toList())
164145
}
146+
esConfig
165147
}
148+
dependsOn = startDependencies
166149
startTasks.add(configureNode(project, prefix, runner, dependsOn, node, config, distro, writeConfigSetup))
167150
}
168151

@@ -381,17 +364,6 @@ class ClusterFormationTasks {
381364
// Don't wait for state, just start up quickly. This will also allow new and old nodes in the BWC case to become the master
382365
'discovery.initial_state_timeout' : '0s'
383366
]
384-
int minimumMasterNodes = node.config.minimumMasterNodes.call()
385-
if (node.nodeVersion.before("7.0.0") && minimumMasterNodes > 0) {
386-
esConfig['discovery.zen.minimum_master_nodes'] = minimumMasterNodes
387-
}
388-
if (node.nodeVersion.before("7.0.0") && esConfig.containsKey('discovery.zen.master_election.wait_for_joins_timeout') == false) {
389-
// If a node decides to become master based on partial information from the pinging, don't let it hang for 30 seconds to correct
390-
// its mistake. Instead, only wait 5s to do another round of pinging.
391-
// This is necessary since we use 30s as the default timeout in REST requests waiting for cluster formation
392-
// so we need to bail quicker than the default 30s for the cluster to form in time.
393-
esConfig['discovery.zen.master_election.wait_for_joins_timeout'] = '5s'
394-
}
395367
esConfig['node.max_local_storage_nodes'] = node.config.numNodes
396368
esConfig['http.port'] = node.config.httpPort
397369
esConfig['transport.tcp.port'] = node.config.transportPort

docs/plugins/integrations.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ releases 2.0 and later do not support rivers.
194194
A pluggable elastic JavaScript query DSL builder for Elasticsearch
195195

196196
* https://www.wireshark.org/[Wireshark]:
197-
Protocol dissection for Zen discovery, HTTP and the binary protocol
197+
Protocol dissection for HTTP and the transport protocol
198198

199199
* https://www.itemsapi.com/[ItemsAPI]:
200200
Search backend for mobile and web

docs/reference/getting-started.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ If everything goes well with installation, you should see a bunch of messages th
248248
[2018-09-13T12:20:05,202][INFO ][o.e.t.TransportService ] [localhost.localdomain] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
249249
[2018-09-13T12:20:05,221][WARN ][o.e.b.BootstrapChecks ] [localhost.localdomain] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
250250
[2018-09-13T12:20:05,221][WARN ][o.e.b.BootstrapChecks ] [localhost.localdomain] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
251-
[2018-09-13T12:20:08,355][INFO ][o.e.c.s.MasterService ] [localhost.localdomain] zen-disco-elected-as-master ([0] nodes joined)[, ], reason: master node changed {previous [], current [{localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test}]}
252-
[2018-09-13T12:20:08,360][INFO ][o.e.c.s.ClusterApplierService] [localhost.localdomain] master node changed {previous [], current [{localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test}]}, reason: apply cluster state (from master [master {localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)[, ]]])
251+
[2018-09-13T12:20:08,355][INFO ][o.e.c.s.MasterService ] [localhost.localdomain] elected-as-master ([0] nodes joined)[, ], reason: master node changed {previous [], current [{localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test}]}
252+
[2018-09-13T12:20:08,360][INFO ][o.e.c.s.ClusterApplierService] [localhost.localdomain] master node changed {previous [], current [{localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test}]}, reason: apply cluster state (from master [master {localhost.localdomain}{B0aEHNagTiWx7SYj-l4NTw}{hzsQz6CVQMCTpMCVLM4IHg}{127.0.0.1}{127.0.0.1:9300}{testattr=test} committed version [1] source [elected-as-master ([0] nodes joined)[, ]]])
253253
[2018-09-13T12:20:08,384][INFO ][o.e.h.n.Netty4HttpServerTransport] [localhost.localdomain] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
254254
[2018-09-13T12:20:08,384][INFO ][o.e.n.Node ] [localhost.localdomain] started
255255

docs/reference/migration/migrate_8_0.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ See also <<release-highlights>> and <<es-release-notes>>.
1212
coming[8.0.0]
1313

1414
* <<breaking_80_analysis_changes>>
15+
* <<breaking_80_discovery_changes>>
1516
* <<breaking_80_mappings_changes>>
1617
* <<breaking_80_snapshots_changes>>
1718

@@ -32,5 +33,6 @@ Elasticsearch 7.x in order to be readable by Elasticsearch 8.x.
3233
=========================================
3334

3435
include::migrate_8_0/analysis.asciidoc[]
36+
include::migrate_8_0/discovery.asciidoc[]
3537
include::migrate_8_0/mappings.asciidoc[]
3638
include::migrate_8_0/snapshots.asciidoc[]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[float]
2+
[[breaking_80_discovery_changes]]
3+
=== Discovery changes
4+
5+
[float]
6+
==== Removal of old discovery settings
7+
8+
All settings under the `discovery.zen` namespace, which existed only for BWC reasons in 7.x,
9+
will no longer be supported. In particular, this includes:
10+
11+
- `discovery.zen.no_master_block`
12+
- `discovery.zen.hosts_provider`
13+
- `discovery.zen.publish_timeout`
14+
- `discovery.zen.commit_timeout`
15+
- `discovery.zen.publish_diff.enable`
16+
- `discovery.zen.ping.unicast.concurrent_connects`
17+
- `discovery.zen.ping.unicast.hosts.resolve_timeout`
18+
- `discovery.zen.ping.unicast.hosts`
19+
- `discovery.zen.unsafe_rolling_upgrades_enabled`
20+
- `discovery.zen.commit_timeout`
21+
- `discovery.zen.fd.connect_on_network_disconnect`
22+
- `discovery.zen.fd.ping_interval`
23+
- `discovery.zen.fd.ping_timeout`
24+
- `discovery.zen.fd.ping_retries`
25+
- `discovery.zen.fd.register_connection_listener`
26+
- `discovery.zen.join_retry_attempts`
27+
- `discovery.zen.join_retry_delay`
28+
- `discovery.zen.max_pings_from_another_master`
29+
- `discovery.zen.send_leave_request`
30+
- `discovery.zen.master_election.wait_for_joins_timeout`
31+
- `discovery.zen.master_election.ignore_non_master_pings`
32+
- `discovery.zen.publish.max_pending_cluster_states`

docs/reference/modules/discovery/discovery-settings.asciidoc

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,14 @@ Discovery and cluster formation are affected by the following settings:
88
Provides a list of master-eligible nodes in the cluster. Each value has the
99
format `host:port` or `host`, where `port` defaults to the setting
1010
`transport.profiles.default.port`. Note that IPv6 hosts must be bracketed.
11-
The default value is `["127.0.0.1", "[::1]"]`. See <<unicast.hosts>>. This
12-
setting was previously known as `discovery.zen.ping.unicast.hosts`. Its old
13-
name is deprecated but continues to work in order to preserve backwards
14-
compatibility. Support for the old name will be removed in a future
15-
version.
11+
The default value is `["127.0.0.1", "[::1]"]`. See <<unicast.hosts>>.
1612

1713
`discovery.seed_providers`::
1814

1915
Specifies which types of <<built-in-hosts-providers,seed hosts provider>>
2016
to use to obtain the addresses of the seed nodes used to start the
2117
discovery process. By default, it is the
22-
<<settings-based-hosts-provider,settings-based seed hosts provider>>. This
23-
setting was previously known as `discovery.zen.hosts_provider`. Its old
24-
name is deprecated but continues to work in order to preserve backwards
25-
compatibility. Support for the old name will be removed in a future
26-
version.
18+
<<settings-based-hosts-provider,settings-based seed hosts provider>>.
2719

2820
`discovery.cluster_formation_warning_timeout`::
2921

@@ -55,20 +47,12 @@ Discovery and cluster formation are affected by the following settings:
5547
`discovery.seed_resolver.max_concurrent_resolvers`::
5648

5749
Specifies how many concurrent DNS lookups to perform when resolving the
58-
addresses of seed nodes. Defaults to `10`. This setting was previously
59-
known as `discovery.zen.ping.unicast.concurrent_connects`. Its old name is
60-
deprecated but continues to work in order to preserve backwards
61-
compatibility. Support for the old name will be removed in a future
62-
version.
50+
addresses of seed nodes. Defaults to `10`.
6351

6452
`discovery.seed_resolver.timeout`::
6553

6654
Specifies how long to wait for each DNS lookup performed when resolving the
67-
addresses of seed nodes. Defaults to `5s`. This setting was previously
68-
known as `discovery.zen.ping.unicast.hosts.resolve_timeout`. Its old name
69-
is deprecated but continues to work in order to preserve backwards
70-
compatibility. Support for the old name will be removed in a future
71-
version.
55+
addresses of seed nodes. Defaults to `5s`.
7256

7357
`cluster.auto_shrink_voting_configuration`::
7458

@@ -192,7 +176,4 @@ APIs are not be blocked and can run on any available node.
192176
* For the cluster to be fully operational, it must have an active master.
193177
===============================
194178

195-
WARNING: This setting replaces the `discovery.zen.no_master_block` setting in
196-
earlier versions. The `discovery.zen.no_master_block` setting is ignored.
197-
198179
--

docs/reference/modules/transport.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ PUT _cluster/settings
156156
{
157157
"transient" : {
158158
"transport.tracer.include" : "*",
159-
"transport.tracer.exclude" : "internal:discovery/zen/fd*"
159+
"transport.tracer.exclude" : "internal:coordination/fault_detection/*"
160160
}
161161
}
162162
--------------------------------------------------

qa/logging-config/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ apply plugin: 'elasticsearch.rest-test'
2323
apply plugin: 'elasticsearch.standalone-test'
2424

2525
integTestCluster {
26-
autoSetInitialMasterNodes = false
2726
autoSetHostsProvider = false
2827
/**
2928
* Provide a custom log4j configuration where layout is an old style pattern and confirm that Elasticsearch

qa/rolling-upgrade/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ for (Version version : bwcVersions.wireCompatible) {
7777
dependsOn lastRunner, "${baseName}#oldClusterTestCluster#node${stopNode}.stop"
7878
clusterName = 'rolling-upgrade'
7979
otherUnicastHostAddresses = { getOtherUnicastHostAddresses() }
80-
autoSetInitialMasterNodes = false
8180
/* Override the data directory so the new node always gets the node we
8281
* just stopped's data directory. */
8382
dataDir = { nodeNumber -> oldClusterTest.nodes[stopNode].dataDir }

0 commit comments

Comments
 (0)