summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-11-11 14:22:57 +0000
committerSimon MacMullen <simon@rabbitmq.com>2013-11-11 14:22:57 +0000
commitf867807a58ccb611c8fc22eef3d01ceb7c8fc312 (patch)
treed348c2967f8ff81ea841e09728f9d3cccebd954f
parente54434c75490ff3995fb97afb5fafd1541ec81f7 (diff)
downloadrabbitmq-server-f867807a58ccb611c8fc22eef3d01ceb7c8fc312.tar.gz
Re-add the log invocations we lost. This does lead to the stale master pid warning getting logged on a different node (the slave node rather than the node that attempted to start the slave) but I doubt we care about that.
-rw-r--r--src/rabbit_mirror_queue_misc.erl7
-rw-r--r--src/rabbit_mirror_queue_slave.erl3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl
index 47a44278..c53ad7b9 100644
--- a/src/rabbit_mirror_queue_misc.erl
+++ b/src/rabbit_mirror_queue_misc.erl
@@ -184,14 +184,15 @@ add_mirror(QName, MirrorNode) ->
end
end).
-start_child(_Name, MirrorNode, Q) ->
- %% TODO re-add some log stuff here.
+start_child(Name, MirrorNode, Q) ->
case rabbit_misc:with_exit_handler(
rabbit_misc:const(down),
fun () ->
rabbit_mirror_queue_slave_sup:start_child(MirrorNode, [Q])
end) of
- {ok, SPid} -> rabbit_mirror_queue_slave:go(SPid);
+ {ok, SPid} -> rabbit_log:info("Adding mirror of ~s on node ~p: ~p~n",
+ [rabbit_misc:rs(Name), MirrorNode, SPid]),
+ rabbit_mirror_queue_slave:go(SPid);
_ -> ok
end.
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index aa69aeed..69e68d20 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -134,6 +134,9 @@ handle_go({not_started, Q = #amqqueue { name = QName }} = NotStarted) ->
rabbit_mirror_queue_misc:maybe_auto_sync(Q1),
{noreply, State};
{stale, StalePid} ->
+ rabbit_log:warning("Detected stale HA master while adding "
+ "mirror of ~s: ~p~n",
+ [rabbit_misc:rs(QName), StalePid]),
gm:leave(GM),
{stop, {stale_master_pid, StalePid}, NotStarted};
duplicate_live_master ->