anchor.diff:              {next_state, compacting, compact_next_bucket(NewState0)}
       end;
   handle_info({'EXIT', Pid, Reason}, StateName,
  -            #state{forced_compactors=Compactors} = State) ->
  -    case dict:find(Pid, Compactors) of
  +            #state{running_forced_compactions=Compactions} = State) ->
  +    case dict:find(Pid, Compactions) of
           {ok, #forced_compaction{type=Type, name=Name}} ->
               case Reason of
                   normal ->
  
positive.code:                       compactor_config=undefined,
                        compaction_start_ts=undefined,
                        scheduled_compaction_tref=undefined,
                        forced_compactors=dict:new()}}.
  
  handle_event(Event, StateName, State) ->
      ?log_warning("Got unexpected event ~p (when in ~p):~n~p",
                   [Event, StateName, State]),
      {next_state, StateName, State}.
  
  handle_sync_event({force_compact_bucket, Bucket},
                    _From, StateName,
                    #state{forced_compactors=Forced} = State) ->
      Record = #forced_compaction{type=bucket,
                                  name=Bucket},
      Configs = compaction_config(Bucket),
      Pid = spawn_bucket_compactor(Bucket, Configs, true),
      NewForced = dict:store(Pid, Record, Forced),
      {reply, ok, StateName, State#state{forced_compactors=NewForced}};
  handle_sync_event({force_compact_db_files, Bucket},
                    _From, StateName,
                    #state{forced_compactors=Forced} = State) ->
      Record = #forced_compaction{type=database,
                                  name=Bucket},
      {Config, _} = compaction_config(Bucket),
      Pid = spawn_dbs_compactor(Bucket, Config, true),
      NewForced = dict:store(Pid, Record, Forced),
      {reply, ok, StateName, State#state{forced_compactors=NewForced}};
  handle_sync_event({force_compact_view, Bucket, DDocId},
                    _From, StateName,
                    #state{forced_compactors=Forced} = State) ->
      RecordName = <<Bucket/binary, $/, DDocId/binary>>,
      Record = #forced_compaction{type=view,
                                  name=RecordName},
      {Config, _} = compaction_config(Bucket),
      Pid = spawn_view_compactor(Bucket, DDocId, Config, true),
      NewForced = dict:store(Pid, Record, Forced),
      {reply, ok, StateName, State#state{forced_compactors=NewForced}};
  handle_sync_event(Event, _From, StateName, State) ->
      ?log_warning("Got unexpected sync event ~p (when in ~p):~n~p",
                   [Event, StateName, State]),
  
negative.code:                  to_minute,
                   abort_outside}).
  
  -record(forced_compaction, {type :: bucket | db | view,
                              name :: binary()}).
  
  % If N vbucket databases of a bucket need to be compacted, we trigger compaction
  % for all the vbucket databases of that bucket.
  