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❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4959 +/- ##
============================================
+ Coverage 70.98% 71.06% +0.07%
- Complexity 58669 58762 +93
============================================
Files 4763 4764 +1
Lines 279945 279966 +21
Branches 40418 40421 +3
============================================
+ Hits 198731 198966 +235
+ Misses 64988 64856 -132
+ Partials 16226 16144 -82 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@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
|
Random tests keep failing 🤔 Should those be marked as flaky and raised a separate ticket to fix? |
Yes let's mute and look at them separately as they are segrep specific. I don't want to block this pr on them. |
|
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.xThen, 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 |
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.