Permalink
Browse files

Add destination node to the name of the TAP stream.

Change-Id: I3d44798d804845009866eaab89c2d6564b2cb206
Reviewed-on: http://review.membase.org/4712
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
1 parent a8065c3 commit bf0ca238dca87afc339d68d09dcd295c41baeaa3 Sean Lynch committed with alk Feb 25, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/ns_vbm_sup.erl
View
@@ -205,7 +205,7 @@ args(Node, Bucket, VBuckets, DstNode, TakeOver) ->
false -> []
end,
{User, Pass} = ns_bucket:credentials(Bucket),
- Name = unique_name(case TakeOver of true -> "t-"; false -> "r-" end),
+ Name = unique_name(case TakeOver of true -> "t"; false -> "r" end, DstNode),
OtherArgs = ["-e", "-a", User,
"-h", ns_memcached:host_port_str(Node),
"-d", ns_memcached:host_port_str(DstNode),
@@ -276,8 +276,8 @@ start_replicas(SrcNode, Bucket, VBuckets, DstNode) ->
%% @doc Generate a unique name with a given prefix that's valid for a TAP queue.
-unique_name(Prefix) ->
+unique_name(Prefix, DstNode) ->
{MegaSecs, Secs, MicroSecs} = now(),
- lists:flatten(io_lib:format("~s~s-~B.~6.10.0B",
- [Prefix, node(), MegaSecs * 1000000 + Secs,
- MicroSecs])).
+ lists:flatten(io_lib:format("~s-~s-~s-~B.~6.10.0B",
+ [Prefix, DstNode, node(),
+ MegaSecs * 1000000 + Secs, MicroSecs])).

0 comments on commit bf0ca23

Please sign in to comment.