anchor.diff:      {ok, #document{value = #node_internal_services{services = NodeServices, processing_node = ProcessingNode}}} =
           node_internal_services:get(MasterNodeID),
   
  -    {maps:get(ServiceName, NodeServices, undefined), ProcessingNode}.+    {maps:get(ServiceName, NodeServices, undefined), ProcessingNode}.
  +
  +-spec remove_service_from_doc(node_id(), internal_service:service_name()) -> ok.
  +remove_service_from_doc(MasterNodeID, ServiceName) ->
  +    Diff = fun(#node_internal_services{services = Services} = Record) ->
  +        {ok, Record#node_internal_services{services = maps:remove(ServiceName, Services)}}
  +    end,
  +    case node_internal_services:update(MasterNodeID, Diff) of
  +        {ok, _} -> ok;
  +        {error, not_found} -> ok
  +    end.
positive.code: 
  %% API
  -export([start_service/5, start_service/6, start_service/3, start_service/4,
      stop_service/3, takeover/1, migrate_to_recovered_master/1,
      do_healtcheck/3, get_processing_node/1]).
  %% Export for internal rpc
  -export([start_service_locally/5]).
  
negative.code:     MasterNodeID = get_node_id(MasterNode),
      case node_internal_services:update(MasterNodeID, Diff, Default) of
          {ok, _} ->
              case internal_service:apply_start_fun(Service) of
                  ok ->
                      HealthcheckInterval = internal_service:get_healthcheck_interval(Service),
                      ok = node_manager:init_service_healthcheck(ServiceName, MasterNodeID, HealthcheckInterval);
                  abort ->
                      remove_service_from_doc(MasterNodeID, ServiceName),
                      aborted
              end;
          {error, already_started} ->
              ok
      end.
  