Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve transient settings deprecation message #79504

Merged
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 @@ -14,9 +14,9 @@ public class ClusterDeprecationChecks {
static DeprecationIssue checkTransientSettingsExistence(ClusterState state) {
if (state.metadata().transientSettings().isEmpty() == false) {
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
"Transient cluster settings are in the process of being removed.",
"Transient cluster settings are deprecated",
"https://ela.st/es-deprecation-7-transient-cluster-settings",
"Use persistent settings to define your cluster settings instead.",
"Use persistent settings to configure your cluster.",
false,
null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,31 @@
public class ClusterDeprecationChecksTests extends ESTestCase {

public void testCheckTransientSettingsExistence() {
Settings persistentSettings = Settings.builder()
.put("xpack.monitoring.collection.enabled", true)
.build();

Settings transientSettings = Settings.builder()
.put("indices.recovery.max_bytes_per_sec", "20mb")
.put("action.auto_create_index", true)
.put("cluster.routing.allocation.enable", "primaries")
.build();
Metadata metadataWithTransientSettings = Metadata.builder()
.persistentSettings(persistentSettings)
.transientSettings(transientSettings)
.build();

ClusterState badState = ClusterState.builder(new ClusterName("test")).metadata(metadataWithTransientSettings).build();
DeprecationIssue issue = ClusterDeprecationChecks.checkTransientSettingsExistence(badState);
assertThat(issue, equalTo(
new DeprecationIssue(DeprecationIssue.Level.WARNING,
"Transient cluster settings are in the process of being removed.",
"Transient cluster settings are deprecated",
"https://ela.st/es-deprecation-7-transient-cluster-settings",
"Use persistent settings to define your cluster settings instead.",
"Use persistent settings to configure your cluster.",
false, null)
));

Settings persistentSettings = Settings.builder()
persistentSettings = Settings.builder()
.put("indices.recovery.max_bytes_per_sec", "20mb")
.build();
Metadata metadataWithoutTransientSettings = Metadata.builder()
Expand Down