anchor.diff:          true ->
               ok;
           false ->
  -            ?log_info("Janitor is going to change "
  -                      "bucket config for bucket ~p", [Bucket]),
  -            ?log_info("VBucket states:~n~p", [States]),
  -            ?log_info("Old bucket config:~n~p", [BucketConfig]),
  -            ok = ns_bucket:set_bucket_config(Bucket, NewBucketConfig)
  +            fixup_vbucket_map(Bucket, BucketConfig, NewBucketConfig, States)
       end,
   
       {NewBucketConfig, IgnoredVBuckets}.
   
  -cleanup_apply_config(Bucket, Servers,
  -                     BucketConfig, IgnoredVBuckets, Options) ->
  +fixup_vbucket_map(Bucket, BucketConfig, NewBucketConfig, States) ->
  +    ?log_info("Janitor is going to change "
  +              "bucket config for bucket ~p", [Bucket]),
  +    ?log_info("VBucket states:~n~p", [States]),
  +    ?log_info("Old bucket config:~n~p", [BucketConfig]),
  +
  +    ok = ns_bucket:set_bucket_config(Bucket, NewBucketConfig),
  +    ok = ns_config_rep:ensure_config_seen_by_nodes().
  +
  +cleanup_apply_config(Bucket,
  +                     Servers, BucketConfig, IgnoredVBuckets, Options) ->
  +    {ok, Result} =
  +        leader_activities:run_activity(
  +          {ns_janitor, Bucket, apply_config}, {all, Servers},
  +          fun () ->
  +                  {ok, cleanup_apply_config_body(Bucket,
  +                                                 Servers, BucketConfig,
  +                                                 IgnoredVBuckets, Options)}
  +          end,
  +          [quiet]),
  +
  +    Result.
  +
  +cleanup_apply_config_body(Bucket, Servers,
  +                          BucketConfig, IgnoredVBuckets, Options) ->
       ApplyTimeout = proplists:get_value(apply_config_timeout,
                                          Options,
                                          undefined_timeout),
  
positive.code:             case ns_bucket:bucket_type(BucketConfig) of
                  membase ->
                      dcp = ns_bucket:replication_type(BucketConfig),
                      cleanup_with_membase_bucket_check_servers(Bucket, Options,
                                                                BucketConfig, FullConfig);
                  _ -> ok
              end
      end.
  
  cleanup_with_membase_bucket_check_servers(Bucket, Options, BucketConfig, FullConfig) ->
      case compute_servers_list_cleanup(BucketConfig, FullConfig) of
  
negative.code:     ?log_debug("janitor decided to update "
                 "servers list for bucket ~p to ~p", [Bucket, Servers]),
  
      ns_bucket:set_servers(Bucket, Servers),
      ok = ns_config_rep:ensure_config_seen_by_nodes().
  
  cleanup_with_membase_bucket_check_map(Bucket, Options, BucketConfig) ->
      case proplists:get_value(map, BucketConfig, []) of
  