summaryrefslogtreecommitdiff
path: root/scripts/rabbitmq-env.bat
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2019-01-22 18:02:40 +0100
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2019-02-01 11:23:15 +0100
commit422687be422d0bed9a53da156dd74b5da93db8ad (patch)
treeff5d39f27ed1685dbfd19a37ec0c0b94c2d3bc31 /scripts/rabbitmq-env.bat
parenta8bc2fc210130a8d989b7d7d877892466f2b802b (diff)
downloadrabbitmq-server-git-422687be422d0bed9a53da156dd74b5da93db8ad.tar.gz
New "Feature flags" subsystem to ease upgrades with breaking changes
The goal is that each breaking change is implemented in way that a RabbitMQ node having that change can work in the same cluster as other nodes which do not know about it. The feature flags are here to indicate which breaking changes are "available" (i.e. the node knows about the breaking changes, but it still runs in a backward-compatible mode) and which ones are currently activated (i.e. the node uses the new code and older node can not be part of the cluster anymore). Enabling a feature flag (i.e. activating a breaking change) is a manual operation where the user validates that the cluster is ready to switch to the new world after the breaking change. Therefore the subsystem ensures RabbitMQ nodes can talk to each other even if they don't have the same code as long as they agree on using the common subset, and prevents RabbitMQ nodes from talking to each other once the new code is being used and one node does not understand it. The consequence is that if a breaking change is implemented using this new subsystem, a cluster can be upgraded one node at a time instead of shutting down the entire cluster to upgrade. Of course, the ability to implement a breaking change in such a way entirely depends on the nature of that change. This new subsystem does not guarantee that a cluster shutdown will never be required again. [#159298729]
Diffstat (limited to 'scripts/rabbitmq-env.bat')
-rw-r--r--scripts/rabbitmq-env.bat17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/rabbitmq-env.bat b/scripts/rabbitmq-env.bat
index 912668c8ac..783fc55287 100644
--- a/scripts/rabbitmq-env.bat
+++ b/scripts/rabbitmq-env.bat
@@ -284,6 +284,15 @@ if "!RABBITMQ_BOOT_MODULE!"=="" (
)
)
+REM [ "x" = "x$RABBITMQ_FEATURE_FLAGS_FILE" ] && RABBITMQ_FEATURE_FLAGS_FILE=${RABBITMQ_MNESIA_BASE}/${RABBITMQ_NODENAME}-feature_flags
+if "!RABBITMQ_FEATURE_FLAGS_FILE!"=="" (
+ if "!FEATURE_FLAGS_FILE!"=="" (
+ set RABBITMQ_FEATURE_FLAGS_FILE=!RABBITMQ_MNESIA_BASE!\!RABBITMQ_NODENAME!-feature_flags
+ ) else (
+ set RABBITMQ_FEATURE_FLAGS_FILE=!FEATURE_FLAGS_FILE!
+ )
+)
+
REM [ "x" = "x$RABBITMQ_PLUGINS_EXPAND_DIR" ] && RABBITMQ_PLUGINS_EXPAND_DIR=${PLUGINS_EXPAND_DIR}
REM [ "x" = "x$RABBITMQ_PLUGINS_EXPAND_DIR" ] && RABBITMQ_PLUGINS_EXPAND_DIR=${RABBITMQ_MNESIA_BASE}/${RABBITMQ_NODENAME}-plugins-expand
if "!RABBITMQ_PLUGINS_EXPAND_DIR!"=="" (
@@ -397,6 +406,13 @@ if defined RABBITMQ_DEV_ENV (
if "!SCRIPT_NAME!" == "rabbitmq-plugins" (
REM We may need to query the running node for the plugins directory
REM and the "enabled plugins" file.
+ if not "%RABBITMQ_FEATURE_FLAGS_FILE_source%" == "environment" (
+ for /f "delims=" %%F in ('!SCRIPT_DIR!\rabbitmqctl eval "{ok, P} = application:get_env(rabbit, feature_flags_file), io:format(""~s~n"", [P])."') do @set feature_flags_file=%%F
+ if exist "!feature_flags_file!" (
+ set RABBITMQ_FEATURE_FLAGS_FILE=!feature_flags_file!
+ )
+ REM set feature_flags_file=
+ )
if not "%RABBITMQ_PLUGINS_DIR_source%" == "environment" (
for /f "delims=" %%F in ('!SCRIPT_DIR!\rabbitmqctl eval "{ok, P} = application:get_env(rabbit, plugins_dir), io:format(""~s~n"", [P])."') do @set plugins_dir=%%F
if exist "!plugins_dir!" (
@@ -476,6 +492,7 @@ exit /b
REM Environment cleanup
set BOOT_MODULE=
set CONFIG_FILE=
+set FEATURE_FLAGS_FILE=
set ENABLED_PLUGINS_FILE=
set LOG_BASE=
set MNESIA_BASE=