anchor.diff:              stat_updates_acc_for_parent = dir_stats_collection:consolidate(
                   CollectionType, StatUpdatesAccForParent, CollectionUpdate)
           }
  -    end),
  -    
  +    end, State),
  +
       ensure_flush_scheduled(UpdatedState#state{has_unflushed_changes = true});
   
   handle_cast(?SCHEDULED_FLUSH, State) ->
  -    flush_internal(State#state{flush_timer_ref = undefined});
  +    flush_all(State#state{flush_timer_ref = undefined});
   
   handle_cast(Info, State) ->
       ?log_bad_request(Info),
  
positive.code: 
  
  %% @private
  -spec reset_last_used_timer(state(), file_id:file_guid(), dir_stats_collection:type()) ->
      {cached_dir_stats(), state()} | no_return().
  reset_last_used_timer(State, Guid, CollectionType) ->
      update_in_cache(State, Guid, CollectionType, fun(CachedDirStats) -> CachedDirStats end).
  
  
  %% @private
  -spec update_in_cache(state(), file_id:file_guid(), dir_stats_collection:type(), 
      fun((cached_dir_stats()) -> cached_dir_stats())) ->
      {UpdatedCachedDirStats :: cached_dir_stats(), state()} | no_return().
  update_in_cache(#state{dir_stats_cache = DirStatsCache} = State, Guid, CollectionType, Diff) ->
      CachedDirStatsKey = gen_cached_dir_stats_key(Guid, CollectionType),
      CachedDirStats = case maps:find(CachedDirStatsKey, DirStatsCache) of
          {ok, DirStatsFromCache} ->
  
negative.code: 
  %% @private
  -spec request_flush(file_id:file_guid(), dir_stats_collection:type(), PruningStrategy :: pruning_strategy()) ->
      ok | ?ERROR_INTERNAL_SERVER_ERROR.
  request_flush(Guid, CollectionType, PruningStrategy) ->
      Request = #dsc_flush_request{
          guid = Guid,
  