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

Make node client type setting a noop #101214

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
6 changes: 6 additions & 0 deletions rest-api-spec/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->

// we can now search using doc values only
task.replaceValueInMatch("fields.object\\.nested1.long.searchable", true)

//client.type no longer exists #101214
task.replaceKeyInMatch("nodes.\$node_id.settings.client.type", "nodes.\$node_id.settings.node.attr.testattr")
task.replaceValueInMatch("nodes.\$node_id.settings.node.attr.testattr", "test")
task.replaceKeyInMatch("nodes.\$node_id.settings.client\\.type", "nodes.\$node_id.settings.node\\.attr\\.testattr")
task.replaceValueInMatch("nodes.\$node_id.settings.node\\.attr\\.testattr", "test")
}

tasks.register('enforceYamlTestConvention').configure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
nodes.info:
metric: [ settings ]

- match : { nodes.$node_id.settings.client.type: node }
- match : { nodes.$node_id.settings.node.attr.testattr: test }

- do:
nodes.info:
metric: [ settings ]
flat_settings: true

- match : { nodes.$node_id.settings.client\.type: node }
- match : { nodes.$node_id.settings.node\.attr\.testattr: test }

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
*/
public interface Client extends ElasticsearchClient, Releasable {

// Note: This setting is registered only for bwc. The value is never read.
Setting<String> CLIENT_TYPE_SETTING_S = new Setting<>("client.type", "node", (s) -> {
return switch (s) {
case "node", "transport" -> s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@ private void construct(Environment initialEnvironment, NodeServiceProvider servi
throws IOException {
// Pass the node settings to the DeprecationLogger class so that it can have the deprecation.skip_deprecated_settings setting:
DeprecationLogger.initialize(initialEnvironment.settings());
Settings environmentSettings = Settings.builder()
.put(initialEnvironment.settings())
.put(Client.CLIENT_TYPE_SETTING_S.getKey(), "node")
.build();
Settings environmentSettings = initialEnvironment.settings();

final JvmInfo jvmInfo = JvmInfo.jvmInfo();
logger.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNodeUtils;
Expand Down Expand Up @@ -74,9 +73,6 @@ public void setup() {
public void testXPackInstalledAttrClash() throws Exception {
Settings.Builder builder = Settings.builder();
builder.put("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR, randomBoolean());
if (randomBoolean()) {
builder.put(Client.CLIENT_TYPE_SETTING_S.getKey(), "transport");
}
XPackPlugin xpackPlugin = createXPackPlugin(builder.put("path.home", createTempDir()).build());
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, xpackPlugin::additionalSettings);
assertThat(
Expand Down