Skip to content

Commit fe15874

Browse files
authored
Don't pass feature flag to non-snapshot artifacts (elastic#80033)
When configuring BWC tests to use feature flags, we need to ensure we don't inadvertently enable the flag on the old version nodes, as those are NOT release builds and therefore fail if the feature flag is present. This commit tweaks our config here to ensure we explicitly enable the flag only on the upgraded nodes. Closes elastic#78219
1 parent 9cac46a commit fe15874

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

qa/full-cluster-restart/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName ->
2323
setting 'indices.memory.shard_inactive_time', '60m'
2424
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
2525
setting 'xpack.security.enabled', 'false'
26-
if (BuildParams.isSnapshotBuild() == false) {
26+
if (BuildParams.isSnapshotBuild() == false && bwcVersion.toString() == project.version) {
2727
systemProperty 'es.index_mode_feature_flag_registered', 'true'
2828
}
2929
}
@@ -42,6 +42,9 @@ BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName ->
4242
useCluster baseCluster
4343
dependsOn "${baseName}#oldClusterTest"
4444
doFirst {
45+
if (BuildParams.isSnapshotBuild() == false) {
46+
baseCluster.get().systemProperty 'es.index_mode_feature_flag_registered', 'true'
47+
}
4548
baseCluster.get().goToNextVersion()
4649
}
4750
systemProperty 'tests.is_old_cluster', 'false'

qa/rolling-upgrade/build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName ->
3636
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
3737
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
3838
setting 'xpack.security.enabled', 'false'
39+
if (BuildParams.isSnapshotBuild() == false && bwcVersion.toString() == project.version) {
40+
systemProperty 'es.index_mode_feature_flag_registered', 'true'
41+
}
3942
}
4043

4144
String oldVersion = bwcVersion.toString()
@@ -57,6 +60,9 @@ BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName ->
5760
dependsOn "${baseName}#oldClusterTest"
5861
useCluster baseCluster
5962
doFirst {
63+
if (BuildParams.isSnapshotBuild() == false) {
64+
baseCluster.get().nodes."${baseName}-0".systemProperty 'es.index_mode_feature_flag_registered', 'true'
65+
}
6066
baseCluster.get().nextNodeToNextVersion()
6167
}
6268
systemProperty 'tests.rest.suite', 'mixed_cluster'
@@ -70,6 +76,9 @@ BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName ->
7076
dependsOn "${baseName}#oneThirdUpgradedTest"
7177
useCluster baseCluster
7278
doFirst {
79+
if (BuildParams.isSnapshotBuild() == false) {
80+
baseCluster.get().nodes."${baseName}-1".systemProperty 'es.index_mode_feature_flag_registered', 'true'
81+
}
7382
baseCluster.get().nextNodeToNextVersion()
7483
}
7584
systemProperty 'tests.rest.suite', 'mixed_cluster'
@@ -82,6 +91,9 @@ BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName ->
8291
tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) {
8392
dependsOn "${baseName}#twoThirdsUpgradedTest"
8493
doFirst {
94+
if (BuildParams.isSnapshotBuild() == false) {
95+
baseCluster.get().nodes."${baseName}-2".systemProperty 'es.index_mode_feature_flag_registered', 'true'
96+
}
8597
baseCluster.get().nextNodeToNextVersion()
8698
}
8799
useCluster testClusters.named(baseName)
@@ -95,9 +107,3 @@ BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName ->
95107
dependsOn tasks.named("${baseName}#upgradedClusterTest")
96108
}
97109
}
98-
99-
testClusters.configureEach {
100-
if (BuildParams.isSnapshotBuild() == false) {
101-
systemProperty 'es.index_mode_feature_flag_registered', 'true'
102-
}
103-
}

x-pack/qa/full-cluster-restart/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName ->
5555
keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode'
5656

5757
setting 'xpack.security.authc.api_key.enabled', 'true'
58-
if (BuildParams.isSnapshotBuild() == false) {
58+
if (BuildParams.isSnapshotBuild() == false && bwcVersion.toString() == project.version) {
5959
systemProperty 'es.index_mode_feature_flag_registered', 'true'
6060
}
6161
}
@@ -78,6 +78,9 @@ BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName ->
7878
useCluster baseCluster
7979
dependsOn "${baseName}#oldClusterTest"
8080
doFirst {
81+
if (BuildParams.isSnapshotBuild() == false) {
82+
systemProperty 'es.index_mode_feature_flag_registered', 'true'
83+
}
8184
testClusters.named(baseName).get().goToNextVersion()
8285
}
8386
systemProperty 'tests.is_old_cluster', 'false'

0 commit comments

Comments
 (0)