]> Entropealabs - cluster_kv.git/commitdiff
difference, not intersection...
authorChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 05:44:26 +0000 (23:44 -0600)
committerChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 05:44:26 +0000 (23:44 -0600)
lib/cluster_kv/ring.ex

index d66db4879f85584cb3b9dd1f3b103b9c904bb941..b4b5157b14783926a3cbbdc99588760e22f5b2ae 100644 (file)
@@ -361,7 +361,7 @@ defmodule ClusterKV.Ring do
       |> Enum.reduce(%{}, fn {k, v}, acc ->
         old_nodes = HashRing.key_to_nodes(old_ring, k, repls) |> MapSet.new()
         new_nodes = HashRing.key_to_nodes(new_ring, k, repls) |> MapSet.new()
-        nodes = MapSet.intersection(new_nodes, old_nodes) |> MapSet.to_list()
+        nodes = MapSet.difference(new_nodes, old_nodes) |> MapSet.to_list()
 
         Enum.reduce(nodes, acc, fn n, a ->
           Map.update(a, n, [], &[{k, v} | &1])