Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private DeprecationChecks() {
NodeDeprecationChecks::checkImplicitlyDisabledSecurityOnBasicAndTrial,
NodeDeprecationChecks::checkSearchRemoteSettings,
NodeDeprecationChecks::checkMonitoringExporterPassword,
NodeDeprecationChecks::checkJoinTimeoutSetting,
NodeDeprecationChecks::checkClusterRoutingAllocationIncludeRelocationsSetting,
NodeDeprecationChecks::checkClusterRoutingRequireSetting,
NodeDeprecationChecks::checkClusterRoutingIncludeSetting,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
import org.elasticsearch.bootstrap.BootstrapSettings;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.coordination.JoinHelper;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
Expand Down Expand Up @@ -597,6 +598,17 @@ static DeprecationIssue checkMonitoringExporterPassword(
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
}

static DeprecationIssue checkJoinTimeoutSetting(final Settings settings,
final PluginsAndModules pluginsAndModules,
final ClusterState clusterState,
final XPackLicenseState licenseState) {
return checkRemovedSetting(settings,
JoinHelper.JOIN_TIMEOUT_SETTING,
"https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_cluster_changes",
DeprecationIssue.Level.CRITICAL
);
}

static DeprecationIssue checkSearchRemoteSettings(
final Settings settings,
final PluginsAndModules pluginsAndModules,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.util.Locale;
import java.util.stream.Collectors;

import static org.elasticsearch.cluster.coordination.JoinHelper.JOIN_TIMEOUT_SETTING;
import static org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING;
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_EXCLUDE_SETTING;
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_INCLUDE_SETTING;
Expand Down Expand Up @@ -804,6 +805,37 @@ public void testMonitoringExporterPassword() {
assertThat(issue, nullValue());
}

public void testJoinTimeoutSetting() {
String settingValue = randomTimeValue(1, 1000, new String[]{"d", "h", "ms", "s", "m"});
String settingKey = JOIN_TIMEOUT_SETTING.getKey();
final Settings nodeSettings = Settings.builder().put(settingKey, settingValue).build();
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
final ClusterState clusterState = ClusterState.EMPTY_STATE;
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
String.format(Locale.ROOT,
"setting [%s] is deprecated and will be removed in the next major version",
settingKey),
"https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_cluster_changes",
String.format(Locale.ROOT,
"the setting [%s] is currently set to [%s], remove this setting",
settingKey,
settingValue),
false, null
);

assertThat(
NodeDeprecationChecks.checkJoinTimeoutSetting(nodeSettings, null, clusterState, licenseState),
equalTo(expectedIssue)
);

final String expectedWarning = String.format(Locale.ROOT,
"[%s] setting was deprecated in Elasticsearch and will be removed in a future release! " +
"See the breaking changes documentation for the next major version.",
settingKey);

assertWarnings(expectedWarning);
}

public void testCheckSearchRemoteSettings() {
// test for presence of deprecated exporter passwords
final int numClusters = randomIntBetween(1, 3);
Expand Down