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

Introduce explicit API for configure test cluster feature flags #83876

Merged

Conversation

mark-vieira
Copy link
Contributor

@mark-vieira mark-vieira commented Feb 11, 2022

Introduce improved handling for enabling feature flags on external test clusters. We are increasingly developing feature behind feature flags. For testing purposes, that means we need to set these flags when testing non-snapshot builds. This is the case both when a) doing release builds and b) when backward compatibility testing against released versions which require the feature flag for certain tests. Until now this was done via convoluted logic in the build scripts themselves. This pull request moves this logic into the test cluster orchestration itself. This means in our build scripts we can simply do this:

requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")

This simply indicates that if we are attempting to start a non-snapshot release node with a version of 8.0.0 or later, we must pass the appropriate flag.

Closes #83822

@mark-vieira mark-vieira added >non-issue :Delivery/Build Build or test infrastructure test-full-bwc Trigger full BWC version matrix tests test-release Trigger CI checks against release build labels Feb 11, 2022
@elasticmachine elasticmachine added the Team:Delivery Meta label for Delivery team label Feb 11, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@mark-vieira
Copy link
Contributor Author

While testing this I'm now discovering that our implementation of feature flags is woefully inconsistent.

Feature flags that are automatically enabled in snapshot builds and fail if you attempt to set them for a snapshot build.
es.index_mode_feature_flag_registered
es.random_sampler_feature_flag_registered
es.encrypted_repository_feature_flag_registered

Feature flags that are automatically enabled in snapshot builds but do not fail if you attempt to set them for a snapshot build.
es.user_profile_feature_flag_enabled

Feature flags that are never automatically enabled and must be explicitly set for all build types.
es.rollup_v2_feature_flag_enabled

Pinging @elastic/es-security and @elastic/es-analytics-geo for guidance on the last two here. Should we modify these to conform with the convention of the first set? We're trying to implement a consistent way to decoratively configure these things during testing and that becomes impossible when they don't follow a convention.

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I certainly like it.

testClustersPlugin.setIsReleasedVersion(
version -> (version.equals(VersionProperties.getElasticsearchVersion()) && BuildParams.isSnapshotBuild() == false)
|| BuildParams.getBwcVersions().unreleasedInfo(version) == null
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"either it is the current version and we're running a release build OR it's not unreleased". That's a lot of double negatives, but I get it.

systemProperty 'es.random_sampler_feature_flag_registered', 'true'
systemProperty 'es.user_profile_feature_flag_enabled', 'true'
}
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 8.1.0 as well, like the ones below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag was introduced in 8.0.0.

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should abbreviate the usage i.e. not embed the full setting name?

requiresFeature 'index_mode', Version.fromString("8.0.0")

@ywangd
Copy link
Member

ywangd commented Feb 13, 2022

Should we modify these to conform with the convention of the first set?

@mark-vieira For es.user_profile_feature_flag_enabled, Yes making it behave consistently with the first set sounds good to me. Thanks a lot for this initiative.

@tvernum
Copy link
Contributor

tvernum commented Feb 14, 2022

The conversation on what our convention should be stalled last year, and is waiting for a new owner.

In the absence of a conclusion about that convention, my view was that the simplest option with es.user_profile_feature_flag_enabled was not to fail if you tried to set it in a snapshot build.

Specifically, the primary reason for needing this PR is because the model used in the other feature flags means that the build needs specific logic to know whether it is OK to set the flag. It's simpler to allow the setting all the time.

I don't mind changing es.user_profile_feature_flag_enabled to match the other flags, but we really need to make a decision about what our feature flag convention is supposed to look like (but we might need to wait until someone has capacity to own that).

@mark-vieira
Copy link
Contributor Author

I wonder if we should abbreviate the usage i.e. not embed the full setting name?

I wanted to but the flags don't use a consistent convention. Some use the enabled suffix while others registered.

@mark-vieira
Copy link
Contributor Author

Ok, for now I've simply made rollup_v2_feature_flag_enabled follow the behavior of being auto-enabled on snapshot builds. This is enough consistency for the testing stuff to work as intended. As @tvernum mentions we should have a longer discussion about how to implement feature flags. They should really be a first-class citizen in our settings/configuration model.

@pugnascotia
Copy link
Contributor

Agreed, I'm confident that feature flags are going to become way more important in the future, so we want to get ahead of that in terms of support in the build and ES itself.

@mark-vieira
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/full-bwc

@mark-vieira mark-vieira merged commit 64929dc into elastic:master Feb 14, 2022
@mark-vieira mark-vieira deleted the test_clusters_feature_flag_improvements branch February 14, 2022 23:22
mark-vieira added a commit to mark-vieira/elasticsearch that referenced this pull request Feb 15, 2022
mark-vieira added a commit to mark-vieira/elasticsearch that referenced this pull request Feb 15, 2022
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Feb 16, 2022
Now that elastic#83876 is in we can have our tests back.

Closes elastic#83926
@nik9000 nik9000 mentioned this pull request Feb 16, 2022
nik9000 added a commit that referenced this pull request Feb 17, 2022
Now that #83876 is in we can have our tests back.

Closes #83926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team test-full-bwc Trigger full BWC version matrix tests test-release Trigger CI checks against release build v8.0.1 v8.1.0 v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] FullClusterRestartIT testSearchTimeSeriesMode failing
7 participants