anchor.diff:                  sync_change => true,
                   local_links_tree_id => LocalTreeId
               },
  -            Ctx3 = datastore_multiplier:extend_name(Key, Ctx2),
  -            DeletedLinks = get_links_mask(Ctx3, Key),
  +            Ctx3 = datastore_multiplier:extend_name(RoutingKey, Ctx2),
  +            DeletedLinks = get_links_mask(Ctx3, Key, RoutingKey),
               Deleted = apply_links_mask(Ctx3, LinksMask, DeletedLinks),
  -            save_links_mask(Ctx, Doc#document{deleted = Deleted});
  +            Ctx2_2 = datastore_multiplier:extend_name(RoutingKey, Ctx),
  +            save_links_mask(Ctx2_2, Doc#document{deleted = Deleted});
           _ ->
               ok
       end;
   links_delete(Doc = #document{
  -    key = Key,
       mutators = [TreeId, RemoteTreeId],
  -    value = #links_mask{model = Model, tree_id = RemoteTreeId},
  +    value = #links_mask{key = RoutingKey, model = Model, tree_id = RemoteTreeId},
       deleted = true
   }) ->
       LocalTreeId = oneprovider:get_provider_id(),
  
positive.code: %%--------------------------------------------------------------------
  -spec links_delete(doc()) -> ok.
  links_delete(Doc = #document{key = Key, value = LinksMask = #links_mask{
      model = Model, tree_id = TreeId
  }, deleted = false}) ->
      LocalTreeId = oneprovider:get_provider_id(),
      case TreeId of
  
negative.code: %% @end
  %%--------------------------------------------------------------------
  -spec save_links_mask(ctx(), doc()) -> ok.
  save_links_mask(Ctx, Doc = #document{key = Key,
      value = #links_mask{key = RoutingKey}}) ->
      {ok, _} = datastore_router:route(Ctx, RoutingKey, save, [
          Ctx, Key, Doc
      ]),
      ok.
  