summaryrefslogtreecommitdiff
path: root/src/rabbit_mirror_queue_sync.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-12-10 12:42:03 +0000
committerSimon MacMullen <simon@rabbitmq.com>2013-12-10 12:42:03 +0000
commitd7b708c3a096bd3f355dee03af4d064f8aec4c47 (patch)
tree71cc8f5a140b28993990b25069767e550324d461 /src/rabbit_mirror_queue_sync.erl
parenta3a42f14505cb1e366a931a74ae21a29a6aee444 (diff)
downloadrabbitmq-server-d7b708c3a096bd3f355dee03af4d064f8aec4c47.tar.gz
Add queue_coordinator / queue_syncer / gm. Shift to getting gen_server2 to store the name in most cases.
Diffstat (limited to 'src/rabbit_mirror_queue_sync.erl')
-rw-r--r--src/rabbit_mirror_queue_sync.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rabbit_mirror_queue_sync.erl b/src/rabbit_mirror_queue_sync.erl
index 61e90105..b4c409b2 100644
--- a/src/rabbit_mirror_queue_sync.erl
+++ b/src/rabbit_mirror_queue_sync.erl
@@ -18,7 +18,7 @@
-include("rabbit.hrl").
--export([master_prepare/3, master_go/7, slave/7]).
+-export([master_prepare/4, master_go/7, slave/7]).
-define(SYNC_PROGRESS_INTERVAL, 1000000).
@@ -61,7 +61,8 @@
-type(slave_sync_state() :: {[{rabbit_types:msg_id(), ack()}], timer:tref(),
bqs()}).
--spec(master_prepare/3 :: (reference(), log_fun(), [pid()]) -> pid()).
+-spec(master_prepare/4 :: (reference(), rabbit_amqqueue:name(),
+ log_fun(), [pid()]) -> pid()).
-spec(master_go/7 :: (pid(), reference(), log_fun(),
rabbit_mirror_queue_master:stats_fun(),
rabbit_mirror_queue_master:stats_fun(),
@@ -80,9 +81,12 @@
%% ---------------------------------------------------------------------------
%% Master
-master_prepare(Ref, Log, SPids) ->
+master_prepare(Ref, QName, Log, SPids) ->
MPid = self(),
- spawn_link(fun () -> syncer(Ref, Log, MPid, SPids) end).
+ spawn_link(fun () ->
+ rabbit_misc:store_proc_name(?MODULE, QName),
+ syncer(Ref, Log, MPid, SPids)
+ end).
master_go(Syncer, Ref, Log, HandleInfo, EmitStats, BQ, BQS) ->
Args = {Syncer, Ref, Log, HandleInfo, EmitStats, rabbit_misc:get_parent()},