-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added support for feature flags in opensearch.yml #4959
Added support for feature flags in opensearch.yml #4959
Conversation
e97ceb1
to
c22e311
Compare
Gradle Check (Jenkins) Run Completed with:
|
c22e311
to
e8cb508
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
e8cb508
to
9543074
Compare
Gradle Check (Jenkins) Run Completed with:
|
@tan31989 This looks like a great start! Are you looking for feedback on this draft or still iterating? One bit of feedback - As an additional test, you can flip SegmentReplicationIT to use node settings at startup by removing the assumeFeatureFlag beforeClass method and pass the settings to startNode where |
@mch2 thanks for the inputs. Apologies that it's taking too much time. I had some personal things to take care of. |
9543074
to
d8247ca
Compare
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #4959 +/- ##
============================================
+ Coverage 70.98% 71.02% +0.03%
- Complexity 58669 58727 +58
============================================
Files 4763 4764 +1
Lines 279945 279966 +21
Branches 40418 40421 +3
============================================
+ Hits 198731 198846 +115
+ Misses 64988 64894 -94
Partials 16226 16226
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@mch2 was debugging the tests by adding the settings to java.lang.IllegalArgumentException: unknown setting [opensearch.experimental.feature.extensions.enabled]
please check that any required plugins are installed, or check the breaking changes
documentation for removed settings
at __randomizedtesting.SeedInfo.seed([F366529BF2371B1C:722EBD885B6BAAE8]:0)
at org.opensearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:591) So, if we add these settings to opensearch.yaml, do we effectively get that ingested during the testing? |
I think we have more American spelling of initialize vs. British initialise. I believe in computers we typically use initialize, care to rename here (and possibly elsewhere, maybe a separate PR)? |
@tan31989 This means that the flag itself is not registered yet as a setting, even though it is properly getting passed in your test. In SettingsModule.java we loop over the existing featureFlags link, and if enabled register the settings that are specific to the feature behind the flag. Before this step happens, we will need to register settings for the flags themselves. Example for just the segrep setting:
And in FeatureFlags.java
After this is done for a particular flag it will register all its settings, which for segrep is the replication type setting. With this code if you were to flip the flag off in your test, you'd see a similar error indicating the type setting is unknown, while the enabled setting still exists with a final value of false.
|
d8247ca
to
32a2a31
Compare
Gradle Check (Jenkins) Run Completed with:
|
32a2a31
to
5ee23a4
Compare
Gradle Check (Jenkins) Run Completed with:
|
5ee23a4
to
5cc38c5
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-4959-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 241bd42ab4d0bff0c6d232df0076d2568e326667
# Push it to GitHub
git push --set-upstream origin backport/backport-4959-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
@tan31989 : The PR to backport to 2.x failed, care to raise a manual backport PR |
@tan31989 Thank you for this change! |
Added a backport PR here #5707 |
…#4959) This change introduces a static store "settings" in FeatureFlags.java file to enable isEnabled method to fetch flag settings defined in opensearch.yml. Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com> Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com>
This change introduces a static store "settings" in FeatureFlags.java file to enable isEnabled method to fetch flag settings defined in opensearch.yml. Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com> Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com> Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com> Co-authored-by: Nagaraj Tantri <nagarajtantri@gmail.com>
This change introduces a static store "settings" in FeatureFlags.java file to enable isEnabled method to fetch flag settings defined in opensearch.yml. Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com> Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com> Signed-off-by: Nagaraj Tantri <nagarajtantri@gmail.com> Co-authored-by: Nagaraj Tantri <nagarajtantri@gmail.com>
This change introduces a static store "settings"
in FeatureFlags.java file to enable the isEnabled method to fetch flag settings defined in opensearch.yml.
Description
This PR addresses issue #4102, wherein, it allows FeatureFlags to be fetched from opensearch.yml and not from the environment variable or system property.
Issues Resolved
[#4102]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.