Skip to content

Commit

Permalink
Fix gradle run on Serverless (elastic#105938)
Browse files Browse the repository at this point in the history
On Serverless it is not possible to configure deprecation indexing (it
is always off). This commit updates the behaviour of
`ElasticsearchCluster` to no longer attempt to configure deprecation
indexing on stateless nodes.
  • Loading branch information
tvernum authored Mar 5, 2024
1 parent 139c94b commit e9ff896
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ private void commonNodeConfig() {
if (node.getTestDistribution().equals(TestDistribution.INTEG_TEST)) {
node.defaultConfig.put("xpack.security.enabled", "false");
} else {
if (node.getVersion().onOrAfter("7.16.0")) {
if (hasDeprecationIndexing(node)) {
node.defaultConfig.put("cluster.deprecation_indexing.enabled", "false");
}
}
Expand Down Expand Up @@ -474,13 +474,17 @@ public void nextNodeToNextVersion() {
commonNodeConfig();
nodeIndex += 1;
if (node.getTestDistribution().equals(TestDistribution.DEFAULT)) {
if (node.getVersion().onOrAfter("7.16.0")) {
if (hasDeprecationIndexing(node)) {
node.setting("cluster.deprecation_indexing.enabled", "false");
}
}
node.start();
}

private static boolean hasDeprecationIndexing(ElasticsearchNode node) {
return node.getVersion().onOrAfter("7.16.0") && node.getSettingKeys().contains("stateless.enabled") == false;
}

@Override
public void extraConfigFile(String destination, File from) {
nodes.all(node -> node.extraConfigFile(destination, from));
Expand Down

0 comments on commit e9ff896

Please sign in to comment.