Skip to content

Commit

Permalink
File Discovery: Remove fallback with zen discovery (#26667)
Browse files Browse the repository at this point in the history
When adding file based discovery, we added a fallback when the discovery
type was set to zen (the default, so everyone got this warning). This
commit removes the fallback for 6.0. Setting file discovery should now
happen explicitly through the hosts_provider setting.

closes #26661
  • Loading branch information
rjernst committed Sep 19, 2017
1 parent a9d9e12 commit 00eec59
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 63 deletions.
1 change: 1 addition & 0 deletions plugins/discovery-file/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ setupSeedNodeAndUnicastHostsFile.doLast {
integTestCluster {
dependsOn setupSeedNodeAndUnicastHostsFile
clusterName = 'discovery-file-test-cluster'
setting 'discovery.zen.hosts_provider', 'file'
extraConfigFile 'discovery-file/unicast_hosts.txt', srcUnicastHostsFile
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,4 @@ public Map<String, Supplier<UnicastHostsProvider>> getZenHostsProviders(Transpor
() -> new FileBasedUnicastHostsProvider(
new Environment(settings, configPath), transportService, fileBasedDiscoveryExecutorService));
}

@Override
public Settings additionalSettings() {
// For 5.0, the hosts provider was "zen", but this was before the discovery.zen.hosts_provider
// setting existed. This check looks for the legacy zen, and sets the file hosts provider if not set
String discoveryType = DiscoveryModule.DISCOVERY_TYPE_SETTING.get(settings);
if (discoveryType.equals("zen")) {
deprecationLogger.deprecated("Using " + DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey() +
" setting to set hosts provider is deprecated. " +
"Set \"" + DiscoveryModule.DISCOVERY_HOSTS_PROVIDER_SETTING.getKey() + ": file\" instead");
if (DiscoveryModule.DISCOVERY_HOSTS_PROVIDER_SETTING.exists(settings) == false) {
return Settings.builder().put(DiscoveryModule.DISCOVERY_HOSTS_PROVIDER_SETTING.getKey(), "file").build();
}
}
return Settings.EMPTY;
}
}

This file was deleted.

0 comments on commit 00eec59

Please sign in to comment.