anchor.diff:  sanify_basic_test() ->
       %% normal case when everything matches vb map
       [a, b] = do_sanify_chain("B", [{a, 0, active}, {b, 0, replica}],
  -                             [a, b], [], 0, []),
  +                             [a, b], [], 0),
   
       %% yes, the code will keep both masters as long as expected master
       %% is there. Possibly something to fix in future
       [a, b] = do_sanify_chain("B", [{a, 0, active}, {b, 0, active}],
  -                             [a, b], [], 0, []),
  +                             [a, b], [], 0),
   
       %% main chain doesn't match but fast-forward chain does
       [b, c] = do_sanify_chain("B", [{a, 0, dead}, {b, 0, active}, {c, 0, replica}],
  -                             [a, b], [b, c], 0, []),
  +                             [a, b], [b, c], 0),
   
       %% main chain doesn't match but ff chain does. And old master is already deleted
       [b, c] = do_sanify_chain("B", [{b, 0, active}, {c, 0, replica}],
  -                             [a, b], [b, c], 0, []),
  +                             [a, b], [b, c], 0),
   
       %% lets make sure we touch all paths just in case
       %% this runs "there are >1 unexpected master" case
       ignore = do_sanify_chain("B", [{a, 0, active}, {b, 0, active}],
  -                             [c, a, b], [], 0, []),
  +                             [c, a, b], [], 0),
       %% this runs "master is one of replicas" case
       [b] = do_sanify_chain("B", [{b, 0, active}, {c, 0, replica}],
  -                          [a, b], [], 0, []),
  +                          [a, b], [], 0),
       %% and this runs "master is some non-chain member node" case
       [c] = do_sanify_chain("B", [{c, 0, active}],
  -                          [a, b], [], 0, []),
  +                          [a, b], [], 0),
   
       %% lets also test rebalance stopped prior to complete takeover
       [a, b] = do_sanify_chain("B", [{a, 0, dead}, {b, 0, replica},
                                      {c, 0, pending}, {d, 0, replica}],
  -                             [a, b], [c, d], 0, []),
  +                             [a, b], [c, d], 0),
       ok.
   
   sanify_doesnt_lose_replicas_on_stopped_rebalance_test() ->
  
positive.code:             ns_janitor_map_recoverer:align_replicas(Map, NumReplicas)
      end.
  
  sanify_chain(Bucket, States, Chain, FutureChain, VBucket, Zombies) ->
      NewChain = do_sanify_chain(Bucket, States, Chain, FutureChain, VBucket, Zombies),
      %% Fill in any missing replicas
      case is_list(NewChain) andalso length(NewChain) < length(Chain) of
          false ->
  
negative.code:                                 ns_rebalancer:generate_initial_map(BucketConfig)
                          end,
  
                      set_initial_map(NewMap, Opts, Bucket, BucketConfig),
  
                      cleanup(Bucket, Options)
              end;
          _ ->
              cleanup_with_membase_bucket_vbucket_map(Bucket, Options, BucketConfig)
      end.
  
  set_initial_map(Map, Opts, Bucket, BucketConfig) ->
      case ns_rebalancer:unbalanced(Map, BucketConfig) of
          false ->
              ns_bucket:update_vbucket_map_history(Map, Opts);
          true ->
              ok
      end,
  
      ns_bucket:set_map(Bucket, Map),
      ns_bucket:set_map_opts(Bucket, Opts).
  
  cleanup_with_membase_bucket_vbucket_map(Bucket, Options, BucketConfig) ->
      Servers = proplists:get_value(servers, BucketConfig, []),
  