Permalink
Browse files

Don't delete destination vbuckets before starting replication

This can cause deleted data to be resurrected if a node is
failed. However, it avoids one path for memory overrun when starting
replication.

Change-Id: I91acd64d6c522303abbaf67ab4d17d2394a3d76a
Reviewed-on: http://review.membase.org/3353
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
1 parent 770219f commit 529bcdafc8393338707937e3b7b0b3efde669a92 @seanlynch seanlynch committed with steveyen Oct 21, 2010
Showing with 0 additions and 16 deletions.
  1. +0 −16 src/ns_vbm_sup.erl
View
@@ -55,21 +55,6 @@ actions(Children) ->
[{VBucket, Dst} || #child_id{vbuckets=VBuckets, dest_node=Dst} <- Children,
VBucket <- VBuckets].
-kill_vbuckets(Node, Bucket, VBuckets) ->
- {ok, States} = ns_memcached:list_vbuckets(Node, Bucket),
- case [X || X = {V, S} <- States, lists:member(V, VBuckets), S /= replica] of
- [] ->
- ok;
- RemainingVBuckets ->
- lists:foreach(fun ({V, dead}) ->
- ns_memcached:delete_vbucket(Node, Bucket, V);
- ({V, _}) ->
- ns_memcached:set_vbucket(Node, Bucket,
- V, dead),
- ns_memcached:delete_vbucket(Node, Bucket, V)
- end, RemainingVBuckets)
- end.
-
set_replicas(Node, Bucket, Replicas) ->
GoodChildren = kill_runaway_children(Node, Bucket, Replicas),
%% Now filter out the replicas that still have children
@@ -83,7 +68,6 @@ set_replicas(Node, Bucket, Replicas) ->
?log_info(
"Starting replica for vbuckets ~w on node ~p",
[VBuckets, Dst]),
- kill_vbuckets(Dst, Bucket, VBuckets),
lists:foreach(
fun (V) ->
ns_memcached:set_vbucket(Dst, Bucket, V,

0 comments on commit 529bcda

Please sign in to comment.