Feature flags: Fix experimental feature flags inventory #7156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we collect feature flag properties from all nodes, we start with an empty cluster inventory (a common Erlang recursion pattern). This means that all feature flags are unknown at first.
In
merge_feature_flags()
, we must compute a global stability level for each feature flag, in case all nodes are not on the same page (like one nodes considers a feature flag experimental, but another one marks it as stable). That's why we rank stability level: required > stable > experimental.This ranking had one issue:
rabbit_feature_flags:get_stability/1
defaults tostable
if a feature flag has not explicit stability set. Therefore, with our empty starting inventory, the starting stability would bestable
. And it would superceed an experimental feature flag stability level, even though all nodes agree on that.Now, if a feature flag is missing from our inventory being collected, we consider its stability level to be experimental. This is different from a known feature flag with no explicit stability level. This way, we are sure that feature flags marked as experimental everywhere will be considered experimental globally.
While here, fix two other small issues:
get_stability/1