anchor.diff:  get_next_stage(wait_for_dbsync) -> clean_database;
   get_next_stage(clean_database) -> finished.
   
  -execute_stage(init, SpaceId, StorageId) ->
  +execute_stage(#state{current_stage = init} = State, SpaceId, StorageId) ->
       % fixme inform zone space unsupported
       % fixme start blockades
       % fixme stop all incoming transfers
       % fixme kill handles
  -    % fixme mozna zrownoleglić (+ qos)
  -    next_stage(SpaceId, StorageId);
  -execute_stage(qos, SpaceId, StorageId) ->
  +    % fixme mozna zrownoleglić (+ qos) -> uzyc traversu 
  +    next_stage(SpaceId, StorageId),
  +    State;
  +execute_stage(#state{current_stage = qos} = State, SpaceId, StorageId) ->
       SpaceGuid = fslogic_uuid:spaceid_to_space_dir_guid(SpaceId),
       % fixme if preferred provider replace AllStorages with provider Id (not really if other providers still allowed)
       Expression = <<?ALL_STORAGES/binary, " - storage_id = ", StorageId/binary>>,
  -    % fixme internal qos (pid to inform? (what if dead - callback))
  -    {ok, QosEntryId} = lfm:add_qos_entry(?ROOT_SESS_ID, {guid, SpaceGuid}, Expression, 1),
  +    {ok, QosEntryId} = lfm:add_qos_entry(?ROOT_SESS_ID, {guid, SpaceGuid}, Expression, 1, ?MODULE),
       ?notice("QosEntry: ~p", [QosEntryId]),
  -    % fixme use qos status sub
       spawn(fun() -> wait_for_qos(QosEntryId, SpaceId, StorageId) end),
  -    ok;
  -execute_stage(clear_storage, SpaceId, StorageId) ->
  -    % fixme remove file_location ()
  +    State#state{id = QosEntryId};
  +execute_stage(#state{current_stage = clear_storage} = State, SpaceId, StorageId) ->
       % fixme do not clean storage if import is on
       {ok, TaskId} = unsupport_traverse:start(SpaceId, StorageId),
       ?notice("TaskId: ~p", [TaskId]),
       % fixme delete space root dir
  -    ok;
  -execute_stage(wait_for_dbsync, SpaceId, StorageId) ->
  +    State#state{id = TaskId};
  +execute_stage(#state{current_stage = wait_for_dbsync} = State, SpaceId, StorageId) ->
       % fixme
       % fixme wait for all docs to be saved on disc
  -    timer:sleep(timer:seconds(15)),
  +    timer:sleep(timer:seconds(60)),
       % fixme stop dbsync
  -    next_stage(SpaceId, StorageId);
  -execute_stage(clean_database, SpaceId, StorageId) ->
  -    % fixme do it first (inform zone, that space is being unsupported)
  +    next_stage(SpaceId, StorageId),
  +    State;
  +execute_stage(#state{current_stage = clean_database} = State, SpaceId, StorageId) ->
  +    % fixme do it in init (inform zone, that space is being unsupported)
       storage_logic:revoke_space_support(StorageId, SpaceId),
       xd(SpaceId, StorageId),
       % fixme find which local documents are to be deleted and to it here (storage:space_unsupported?), space_quota
  
positive.code:         [{since, 0}, {until, Until}], [self()]
      ).
  
  % fixme almost the same as in dbsync_changes
  links_save(Model, RoutingKey, Doc = #document{key = Key}) ->
      Ctx = datastore_model_default:get_ctx(Model),
      Ctx2 = Ctx#{
          local_links_tree_id => oneprovider:get_id(),
          routing_key => RoutingKey
      },
      Ctx3 = datastore_multiplier:extend_name(RoutingKey, Ctx2),
      case datastore_router:route(save, [Ctx3#{expiry => ?EXPIRY}, Key, Doc]) of
          {ok, Doc2} ->
              Doc2;
          {error, ignored} ->
              undefined
      end.
  
negative.code:             {noreply, State#{{SpaceId, StorageId} => #state{current_stage = NextStage}}}
      end.
      
      
  handle_info(_Info, State) ->
      % fixme log
      {noreply, State}.
  