diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2017-09-11 00:31:25 -0400 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2017-09-11 00:31:25 -0400 |
| commit | 52ab32e5fb9c4465091a9b6e7305f66942607687 (patch) | |
| tree | 4797ea5b1b3fae29aef509355c17686c22a494a5 | |
| parent | f34890e89c51d21a3fc3714d63d8ad1b15fc9352 (diff) | |
| download | rabbitmq-server-git-52ab32e5fb9c4465091a9b6e7305f66942607687.tar.gz | |
Make it possible to configure randomized startup delay range via new style configv3.7.0-beta.20
| -rw-r--r-- | priv/schema/rabbit.schema | 26 | ||||
| -rw-r--r-- | test/config_schema_SUITE_data/rabbit.snippets | 23 |
2 files changed, 49 insertions, 0 deletions
diff --git a/priv/schema/rabbit.schema b/priv/schema/rabbit.schema index cd6d7a6781..660f85d915 100644 --- a/priv/schema/rabbit.schema +++ b/priv/schema/rabbit.schema @@ -833,6 +833,32 @@ fun(Conf) -> end end}. +%% Cluster formation: Randomized startup delay + +{mapping, "cluster_formation.randomized_startup_delay_range.min", "rabbit.cluster_formation.randomized_delay_range", + [{datatype, integer}]}. +{mapping, "cluster_formation.randomized_startup_delay_range.max", "rabbit.cluster_formation.randomized_delay_range", + [{datatype, integer}]}. + +{translation, "rabbit.cluster_formation.randomized_delay_range", +fun(Conf) -> + Min = cuttlefish:conf_get("cluster_formation.randomized_startup_delay_range.min", Conf, undefined), + Max = cuttlefish:conf_get("cluster_formation.randomized_startup_delay_range.max", Conf, undefined), + + case {Min, Max} of + {undefined, undefined} -> + cuttlefish:unset(); + {undefined, Max} -> + %% fallback default + {5, Max}; + {Min, undefined} -> + %% fallback default + {Min, 60}; + {Min, Max} -> + {Min, Max} + end +end}. + %% Classic config-driven peer discuvery backend. %% %% Make clustering happen *automatically* at startup - only applied diff --git a/test/config_schema_SUITE_data/rabbit.snippets b/test/config_schema_SUITE_data/rabbit.snippets index cbe1eb4624..52babbd34a 100644 --- a/test/config_schema_SUITE_data/rabbit.snippets +++ b/test/config_schema_SUITE_data/rabbit.snippets @@ -372,6 +372,29 @@ tcp_listen_options.exit_on_close = false", "tcp_listen_options.linger.timeout = 100", [{rabbit,[{tcp_listen_options,[{linger,{false,100}}]}]}], []}, + + {cluster_formation_randomized_startup_delay_both_values, + "cluster_formation.randomized_startup_delay_range.min = 10 + cluster_formation.randomized_startup_delay_range.max = 30", + [{rabbit, [{cluster_formation, [ + {randomized_delay_range, {10, 30}} + ]}]}], + []}, + + {cluster_formation_randomized_startup_delay_min_only, + "cluster_formation.randomized_startup_delay_range.min = 10", + [{rabbit, [{cluster_formation, [ + {randomized_delay_range, {10, 60}} + ]}]}], + []}, + + {cluster_formation_randomized_startup_delay_max_only, + "cluster_formation.randomized_startup_delay_range.max = 30", + [{rabbit, [{cluster_formation, [ + {randomized_delay_range, {5, 30}} + ]}]}], + []}, + {cluster_formation_dns, "cluster_formation.peer_discovery_backend = rabbit_peer_discovery_dns cluster_formation.dns.hostname = 192.168.0.2.xip.io |
