Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 529bcdafc8393338707937e3b7b0b3efde669a92 1 parent 770219f
@seanlynch seanlynch authored steveyen committed
Showing with 0 additions and 16 deletions.
  1. +0 −16 src/ns_vbm_sup.erl
View
16 src/ns_vbm_sup.erl
@@ -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,
Please sign in to comment.
Something went wrong with that request. Please try again.