anchor.diff:                is_master(Chain) orelse is_replica(Chain)
         end, Pred, Map, States).
   
  -build_map(BucketConfig, VBucketStates) ->
  +build_map(BucketConfig, VBucketStates, UseReplicaIndex) ->
       Map = proplists:get_value(map, BucketConfig),
       FFMap = case proplists:get_value(fastForwardMap, BucketConfig) of
                   undefined ->
  
positive.code:                 [Bucket, DDocId,
                   Active, Passive, Cleanup, Replica, ReplicaCleanup]),
  
      apply_ddoc_map(Bucket, DDocId,
                     Active, Passive, Cleanup, Replica, ReplicaCleanup).
  
  apply_ddoc_map(Bucket, DDocId,
                 Active, Passive, Cleanup, Replica, ReplicaCleanup) ->
      SetName = list_to_binary(Bucket),
  
      try
  
negative.code:             ok
      end,
  
      apply_ddoc_map(Bucket, DDocId, undefined, Map, UseReplicaIndex).
  
  maybe_define_group(Bucket, BucketConfig, DDocId, Map, UseReplicaIndex) ->
      try
          define_group(Bucket, BucketConfig, DDocId, Map, UseReplicaIndex)
      catch
          throw:view_already_defined ->
              ok
      end.
  
  apply_ddoc_map(Bucket, DDocId, OldMap, NewMap, UseReplicaIndex) ->
      ?views_info("Applying map to bucket ~s (ddoc ~s):~n~p",
                  [Bucket, DDocId, NewMap]),
  
  