Skip to content

Commit fc74118

Browse files
Merge pull request #13675 from rabbitmq/mergify/bp/v4.1.x/pr-13673
Added 'unlimited' config setting for peer_discovery_retry_limit (backport #13673)
2 parents a810bf1 + 668178d commit fc74118

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

deps/rabbit/priv/schema/rabbit.schema

+13-4
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,19 @@ end}.
14011401
]}.
14021402

14031403
{mapping, "cluster_formation.discovery_retry_limit", "rabbit.cluster_formation.discovery_retry_limit",
1404-
[
1405-
{datatype, integer},
1406-
{validators, ["non_zero_positive_integer"]}
1407-
]}.
1404+
[{datatype, [{atom, unlimited}, integer]}]}.
1405+
1406+
{translation, "rabbit.cluster_formation.discovery_retry_limit",
1407+
fun(Conf) ->
1408+
case cuttlefish:conf_get("cluster_formation.discovery_retry_limit", Conf, undefined) of
1409+
undefined -> cuttlefish:unset();
1410+
unlimited -> unlimited;
1411+
Val when is_integer(Val) andalso Val > 0 -> Val;
1412+
_ -> cuttlefish:invalid("should be positive integer or 'unlimited'")
1413+
end
1414+
end
1415+
}.
1416+
14081417
{mapping, "cluster_formation.discovery_retry_interval", "rabbit.cluster_formation.discovery_retry_interval",
14091418
[
14101419
{datatype, integer},

deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets

+18-6
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ cluster_formation.classic_config.nodes.peer2 = rabbit@hostname2",
274274
[{peer_discovery_backend,rabbit_peer_discovery_classic_config}]},
275275
{cluster_nodes,{[rabbit@hostname2,rabbit@hostname1],disc}}]}],
276276
[]},
277-
277+
278278
{cluster_formation_module_dns_alias,
279279
"cluster_formation.peer_discovery_backend = dns
280280
cluster_formation.dns.hostname = discovery.eng.example.local",
@@ -287,7 +287,7 @@ cluster_formation.dns.hostname = discovery.eng.example.local",
287287
]}]}
288288
]}],
289289
[]},
290-
290+
291291
{cluster_formation_disk,
292292
"cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config
293293
cluster_formation.classic_config.nodes.peer1 = rabbit@hostname1
@@ -758,17 +758,17 @@ tcp_listen_options.exit_on_close = false",
758758
{fail_if_no_peer_cert, false},
759759
{honor_ecc_order, true}]}]}],
760760
[]},
761-
761+
762762
{ssl_cert_login_from_cn,
763763
"ssl_cert_login_from = common_name",
764764
[{rabbit,[{ssl_cert_login_from, common_name}]}],
765765
[]},
766-
766+
767767
{ssl_cert_login_from_dn,
768768
"ssl_cert_login_from = distinguished_name",
769769
[{rabbit,[{ssl_cert_login_from, distinguished_name}]}],
770770
[]},
771-
771+
772772
{ssl_cert_login_from_san_dns,
773773
"ssl_cert_login_from = subject_alternative_name
774774
ssl_cert_login_san_type = dns
@@ -779,7 +779,7 @@ tcp_listen_options.exit_on_close = false",
779779
{ssl_cert_login_san_index, 0}
780780
]}],
781781
[]},
782-
782+
783783

784784
{ssl_options_bypass_pem_cache,
785785
"ssl_options.bypass_pem_cache = true",
@@ -838,6 +838,18 @@ tcp_listen_options.exit_on_close = false",
838838
[{peer_discovery_backend,rabbit_peer_discovery_classic_config},
839839
{node_type,ram}]}]}],
840840
[]},
841+
{cluster_formation_retry_limit_integer,
842+
"cluster_formation.discovery_retry_limit = 500",
843+
[{rabbit,
844+
[{cluster_formation,
845+
[{discovery_retry_limit, 500}]}]}],
846+
[]},
847+
{cluster_formation_retry_limit_infinity,
848+
"cluster_formation.discovery_retry_limit = unlimited",
849+
[{rabbit,
850+
[{cluster_formation,
851+
[{discovery_retry_limit, unlimited}]}]}],
852+
[]},
841853
{background_gc_enabled,
842854
"background_gc_enabled = true
843855
background_gc_target_interval = 30000",

0 commit comments

Comments
 (0)