anchor.diff:  
       {ok, _Timer} = timer:send_interval(?SYNC_INTERVAL, sync),
   
  +    InitialDDocs = get_design_docs(Bucket),
  +
       State = #state{bucket=Bucket,
  -                   master_db_watcher=Watcher},
  +                   master_db_watcher=Watcher,
  +                   ddocs=InitialDDocs},
   
       {ok, apply_current_map(State)}.
   
  
positive.code: sync(#state{bucket=Bucket,
              bucket_config=BucketConfig,
              pending_vbucket_states=PendingStates,
              map=Map} = State) ->
      NewMap = build_map(BucketConfig, PendingStates),
      case NewMap =/= Map of
          true ->
              apply_map(Bucket, BucketConfig, Map, NewMap),
              State#state{vbucket_states=PendingStates, map=NewMap};
          false ->
              State#state{vbucket_states=PendingStates}
      end.
  
negative.code:               ok
        end).
  
  apply_current_map(#state{bucket=Bucket, ddocs=DDocs} = State) ->
      {ok, BucketConfig} = ns_bucket:get_bucket(Bucket),
      VBucketStates = get_vbucket_states(Bucket, BucketConfig),
      Map = build_map(BucketConfig, VBucketStates),
      apply_map(Bucket, DDocs, undefined, Map),
      State#state{bucket_config=BucketConfig,
                  vbucket_states=VBucketStates,
                  pending_vbucket_states=VBucketStates,
  