-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] Unable to flip feature flags defined in FeatureFlags.java #9564
Comments
I think that a feature flag that allows a default value should ... respect that default value, so this is a real bug. Do you think you can turn it into a unit test? |
I guess we can use the existing BUILT_IN_FEATURE_FLAGS set and modify isEnabled . The behaviour of Proposal draft PR: #9691 [Pending UT and log line removal] Thoughts ? |
I am not sure, feels like a workaround for the problem instead of fixing the actual problem. I'd really start by writing tests that reproduce the various states of feature flags, then it becomes easy to try and produce a fix that works in all cases. |
@dblock, can you confirm what is expectation out of the below ones:
|
I don't have the answers to these without digging deep into what's supposed to be returned or existing tests. I was noting that you found one case where the flag doesn't work as one would expect, so I was commenting on wanting tests (some may exist) that cover all permutations. PS: Do note that settings can also be declared in plugins. |
If I understand correctly, |
@noCharger No
here ^ the argument ( The defaultValue function implementation while initializing the featureFlag
|
@jayeshathila -- can we assign this issue to you, since it looks like you've been working on a fix? |
@msfroh Sure, please assign it to me. |
Closing this issue as #12849 was merged. |
Describe the bug
The feature flags used for experimental are defined here. This below example creates an setting static object with the feature flag name and default value.
However, if the feature flag is not specified as an env variable or written in the yml file, the FeatureFlags.isEnabled method does not read the value from these static settings and instead sets to 'false' by default.
Because these feature flag settings are never initialized / registered during node boostrap, it causes the difficulty when adding a static setting with the default value of
true
to keep the feature enabled but still gated behind the flag.For example on node.java, if the default value on
FeatureFlags.IDENTITY
is set totrue
, the FeatureFlags.isEnabled will always returnfalse
.To Reproduce
Steps to reproduce the behavior:
true
OpenSearch/server/src/main/java/org/opensearch/common/util/FeatureFlags.java
Line 103 in 8cfde6c
OpenSearch/server/src/main/java/org/opensearch/node/Node.java
Lines 467 to 473 in 8cfde6c
Expected behavior
Some options here
false
. On public doc and java doc, we should explictly mention that flags are required to be removed when you want to enable the feature.The text was updated successfully, but these errors were encountered: