summaryrefslogtreecommitdiff
path: root/src/rabbit_mirror_queue_slave.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-04-23 14:57:50 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-04-23 14:57:50 +0100
commit3059534426122b0aa27182286958d46910d9cdef (patch)
tree3f3db401246d5b863f9d5bae8a1c1aff68e4aa48 /src/rabbit_mirror_queue_slave.erl
parent074d731e6e978855006aa6d924e568db98e9d775 (diff)
downloadrabbitmq-server-3059534426122b0aa27182286958d46910d9cdef.tar.gz
Introduce a new function for the case of dropping a master because we synced - remove a deadlock.bug26125
Diffstat (limited to 'src/rabbit_mirror_queue_slave.erl')
-rw-r--r--src/rabbit_mirror_queue_slave.erl8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index f6acd91a..ee889f84 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -922,8 +922,6 @@ update_ram_duration(BQ, BQS) ->
rabbit_memory_monitor:report_ram_duration(self(), RamDuration),
BQ:set_ram_duration_target(DesiredDuration, BQS1).
-%% [1] - the arrival of this newly synced slave may cause the master to die if
-%% the admin has requested a migration-type change to policy.
record_synchronised(#amqqueue { name = QName }) ->
Self = self(),
case rabbit_misc:execute_mnesia_transaction(
@@ -934,9 +932,9 @@ record_synchronised(#amqqueue { name = QName }) ->
[Q1 = #amqqueue { sync_slave_pids = SSPids }] ->
Q2 = Q1#amqqueue{sync_slave_pids = [Self | SSPids]},
rabbit_mirror_queue_misc:store_updated_slaves(Q2),
- {ok, Q1, Q2}
+ {ok, Q2}
end
end) of
- ok -> ok;
- {ok, Q1, Q2} -> rabbit_mirror_queue_misc:update_mirrors(Q1, Q2) %% [1]
+ ok -> ok;
+ {ok, Q} -> rabbit_mirror_queue_misc:maybe_drop_master_after_sync(Q)
end.