summaryrefslogtreecommitdiff
path: root/src/rabbit_mirror_queue_misc.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-10-24 13:25:03 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-10-24 13:25:03 +0100
commit839c886755d361caf8b909f958eedd74a42083ee (patch)
treedfd5424d8ac228a0ca80d32587b4a6019ddf4c4b /src/rabbit_mirror_queue_misc.erl
parent46b2632199b75cf16a17fd47fd530f25352ac3e3 (diff)
downloadrabbitmq-server-839c886755d361caf8b909f958eedd74a42083ee.tar.gz
If the current master is currently not in the nodes specified, act like it is for the purposes of suggested_queue_nodes - otherwise we will not return it in the results.bug25243
Diffstat (limited to 'src/rabbit_mirror_queue_misc.erl')
-rw-r--r--src/rabbit_mirror_queue_misc.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl
index 4a00846e..8a363f76 100644
--- a/src/rabbit_mirror_queue_misc.erl
+++ b/src/rabbit_mirror_queue_misc.erl
@@ -268,7 +268,11 @@ policy(Policy, Q) ->
suggested_queue_nodes(<<"all">>, _Params, {MNode, _SNodes}, Possible) ->
{MNode, Possible -- [MNode]};
suggested_queue_nodes(<<"nodes">>, Nodes0, {MNode, _SNodes}, Possible) ->
- Nodes = [list_to_atom(binary_to_list(Node)) || Node <- Nodes0],
+ Nodes1 = [list_to_atom(binary_to_list(Node)) || Node <- Nodes0],
+ %% If the current master is currently not in the nodes specified,
+ %% act like it is for the purposes below - otherwise we will not
+ %% return it in the results...
+ Nodes = lists:usort([MNode | Nodes1]),
Unavailable = Nodes -- Possible,
Available = Nodes -- Unavailable,
case Available of