Skip to content

Commit

Permalink
Validate that test cluster BWC nodes use the default distribution (#1…
Browse files Browse the repository at this point in the history
…06559) (#106565)

We have instances where BWC tests configure old ES version nodes with
the integTest distribution. This isn't a valid configuration, and while
we in reality resolve the default distribution artifact, we have other
configuration logic that behaves differently based on whether the
integTest distro was _requested_. Specifically, what to set ES_JAVA_HOME
to. This bug resulted in us attempting to run old nodes using the
current bundled JDK version, which may be incompatible with that older
version of Elasticsearch.

Closes #104858
  • Loading branch information
mark-vieira authored Mar 20, 2024
1 parent 4bf910c commit d1c98f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ void validate() {
if (nodeNames.isEmpty() == false) {
throw new IllegalArgumentException("Cluster cannot contain nodes with duplicates names: " + nodeNames);
}

// Ensure we do not configure older version nodes with the integTest distribution
if (nodes.stream().anyMatch(n -> n.getVersion() != Version.CURRENT && n.getDistributionType() == DistributionType.INTEG_TEST)) {
throw new IllegalArgumentException(
"Error configuring test cluster '"
+ name
+ "'. When configuring a node for a prior Elasticsearch version, the default distribution type must be used."
);
}
}

public static class LocalNodeSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class RemoteClusterSecurityBwcRestIT extends AbstractRemoteClusterSecurit
static {
fulfillingCluster = ElasticsearchCluster.local()
.version(OLD_CLUSTER_VERSION)
.distribution(DistributionType.INTEG_TEST)
.distribution(DistributionType.DEFAULT)
.name("fulfilling-cluster")
.apply(commonClusterConfig)
.setting("xpack.ml.enabled", "false")
Expand Down

0 comments on commit d1c98f3

Please sign in to comment.