anchor.diff:                end
         end, [], IndexedList).
   
  +matching_vbuckets(Pred, Map, States) ->
  +    matching_indexes(
  +      fun (Ix, [MasterNode | _]) ->
  +              case MasterNode =:= node() of
  +                  true ->
  +                      VBucketState = dict:fetch(Ix, States),
  +                      Pred(Ix, VBucketState);
  +                  false ->
  +                      false
  +              end
  +      end, Map).
  +
   build_map(BucketConfig, VBucketStates) ->
       Map = proplists:get_value(map, BucketConfig),
   
       case Map of
           undefined ->
  -            [{active, []}, {passive, []}];
  +            [{active, []}, {passive, []}, {ignore, []}];
           _ ->
  -            Active = matching_indexes(
  -                       fun (Ix, [MasterNode | _]) ->
  -                               case MasterNode =:= node() of
  -                                   true ->
  -                                       VBucketState =
  -                                           dict:fetch(Ix, VBucketStates),
  -                                       VBucketState =:= active;
  -                                   false ->
  -                                       false
  -                               end
  -                       end, Map),
  +            Active = matching_vbuckets(
  +                       fun (_Vb, State) ->
  +                               State =:= active
  +                       end, Map, VBucketStates),
  +
  +            Ignore = matching_vbuckets(
  +                       fun (_Vb, State) ->
  +                               State =:= dead
  +                       end, Map, VBucketStates),
   
               FFMap = proplists:get_value(fastForwardMap, BucketConfig),
               Passive =
  
positive.code:                         [];
                      _ ->
                          Passive1 =
                              matching_indexes(
                                fun (Ix, [MasterNode | _]) ->
                                        case MasterNode =:= node() of
                                            true ->
                                                VBucketState =
                                                    dict:fetch(Ix, VBucketStates),
                                                VBucketState =:= active orelse
                                                    VBucketState =:= replica orelse
                                                    VBucketState =:= pending;
                                            false ->
                                                false
                                        end
                                end, FFMap),
                          Passive1 -- Active
                  end,
  
              [{active, Active},
               {passive, Passive}]
      end.
  
  define_group(Bucket, BucketConfig, DDocId, Map) ->
  
negative.code: 
      Active = proplists:get_value(active, NewMap),
      Passive = proplists:get_value(passive, NewMap),
      Ignore = proplists:get_value(ignore, NewMap),
  
      ToRemove =
          case OldMap of
  