summaryrefslogtreecommitdiff
path: root/src/rabbit.erl
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2019-03-01 16:54:50 +0100
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2019-03-01 17:42:50 +0100
commit564bca6b67e7d4a9f15d343e19fe41e7ec1787c5 (patch)
tree6d7755e34b66fdc78908e9ace1d669ed1a81ea40 /src/rabbit.erl
parent8fa76df354eb0156af232453cfcefd4087b63b81 (diff)
downloadrabbitmq-server-git-564bca6b67e7d4a9f15d343e19fe41e7ec1787c5.tar.gz
Feature flags: Handle plugins' feature flags only present on some nodes
Before this patch, when a node had a plugin which provided a feature flag, that node could not join a cluster because the other nodes didn't know about that plugin's feature flag. This was the same problem when an operator enabled a plugin present on some nodes (but not all) in a cluster and then wanted to enable the plugin's feature flags. This situation is fixed by paying attention to the Erlang applications (plugins) providing each feature flag, when we want to determine if two nodes are compatible. To achieve this and still maintain the same view & state on all nodes, when a node (re)joins a cluster, all feature flags from both sides are exchanged: if a feature flag on one side is provided by an application which is missing on the other side, that feature flag is added to the latter's registry. After this exchange, we proceed with the regular compatibility check. Therefore, feature flags provided by unknown applications are supported everywhere and thus won't interfere. Also in this patch is a fix of the registry generation: the way feature flag states were handled was incorrect: reinitializing the registry could loose states because `initialize_registry/3` would take the complete list of enabled feature flags. Now it is transformed to take a "diff": a map indicating which feature flags are enabled/disabled or marked as `state_changing`. We now store a map of those states inside the registry. One change of behavior with this patch is: feature flags are enabled by default only if it is a virgin node (it is the first time it starts or it was reset), even if it is a single non-clustered node. Finally, the testsuite for feature flags was expanded to cover various clustering and plugin activation situations. [#163796129]
Diffstat (limited to 'src/rabbit.erl')
-rw-r--r--src/rabbit.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 222b6cf3c0..20f9b17abf 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -520,7 +520,7 @@ start_apps(Apps) ->
start_apps(Apps, RestartTypes) ->
app_utils:load_applications(Apps),
- rabbit_feature_flags:initialize_registry(),
+ ok = rabbit_feature_flags:refresh_feature_flags_after_app_load(Apps),
start_loaded_apps(Apps, RestartTypes).
start_loaded_apps(Apps) ->