anchor.diff:  
   sanify(Bucket, Map, Servers) ->
       {ok, States, _Zombies} = current_states(Servers, Bucket),
  -    sanify(Bucket, States, Map, 0).
  -
  -sanify(_, _, [], _) ->
  -    ok;
  -sanify(Bucket, States, [Chain|Map], VBucket) ->
  +    [sanify_chain(Bucket, States, Chain, VBucket)
  +     || {VBucket, Chain} <- misc:enumerate(Map, 0)].
  +
  +sanify_chain(Bucket, States, Chain, VBucket) ->
       NodeStates = [{N, S} || {N, V, S} <- States, V == VBucket],
       ChainStates = lists:map(fun (N) ->
                                       case lists:keyfind(N, 1, NodeStates) of
  
positive.code: -export([cleanup/3, current_states/2, graphviz/1]).
  
  cleanup(Bucket, Map, Servers) ->
      sanify(Bucket, Map, Servers),
      Replicas = lists:keysort(1, map_to_replicas(Map)),
      ReplicaGroups = lists:ukeymerge(1, misc:keygroup(1, Replicas),
                                      [{N, []} || N <- lists:sort(Servers)]),
  
negative.code:                               ns_memcached:set_vbucket_state(
                                  N, Bucket, VBucket, dead)
                        end
                end, ExtraStates),
              Chain;
          [{Master, State}|ReplicaStates] ->
              case [N||{N, RState} <- ReplicaStates ++ ExtraStates,
                       lists:member(RState, [active, pending, replica])] of
                  [] ->
                      error_logger:info_msg("~p:sanify: Setting master ~p for (hopefully new) vbucket ~p from ~p to active~n",
                                            [?MODULE, Master, VBucket, State]),
                      ns_memcached:set_vbucket_state(Master, Bucket, VBucket, active),
                      Chain;
                  X ->
                      error_logger:error_msg("~p:sanify: Master ~p in state ~p for vbucket ~p but we have extra nodes ~p!~n",
                                             [?MODULE, Master, State, VBucket, X]),
                      Chain
              end
      end.
  
  %% [{Node, VBucket, State}...]
  -spec current_states(list(atom()), string()) ->
  