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:                               [Type, Name, Reason])
              end,
  
              NewCompactors = dict:erase(Pid, Compactors),
              {next_state, StateName,
               State#state{forced_compactors=NewCompactors}};
          error ->
              ?log_error("Unexpected process termination ~p: ~p. Dying.",
                         [Pid, Reason]),
  
negative.code:                       compactor_config=undefined,
                        compaction_start_ts=undefined,
                        scheduled_compaction_tref=undefined,
                        running_forced_compactions=dict:new(),
                        forced_compaction_pids=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) ->
      Compaction = #forced_compaction{type=bucket, name=Bucket},
  
      NewState =
          case is_already_being_compacted(Compaction, State) of
              true ->
                  State;
              false ->
                  Configs = compaction_config(Bucket),
                  Pid = spawn_bucket_compactor(Bucket, Configs, true),
                  register_forced_compaction(Pid, Compaction, State)
          end,
      {reply, ok, StateName, NewState};
  handle_sync_event({force_compact_db_files, Bucket}, _From, StateName, State) ->
      Compaction = #forced_compaction{type=db, name=Bucket},
  
      NewState =
          case is_already_being_compacted(Compaction, State) of
              true ->
                  State;
              false ->
                  {Config, _} = compaction_config(Bucket),
                  Pid = spawn_dbs_compactor(Bucket, Config, true),
                  register_forced_compaction(Pid, Compaction, State)
          end,
      {reply, ok, StateName, NewState};
  handle_sync_event({force_compact_view, Bucket, DDocId}, _From, StateName, State) ->
      Name = <<Bucket/binary, $/, DDocId/binary>>,
      Compaction = #forced_compaction{type=view, name=Name},
  
      NewState =
          case is_already_being_compacted(Compaction, State) of
              true ->
                  State;
              false ->
                  {Config, _} = compaction_config(Bucket),
                  Pid = spawn_view_compactor(Bucket, DDocId, Config, true),
                  register_forced_compaction(Pid, Compaction, State)
          end,
      {reply, ok, StateName, NewState};
  handle_sync_event(Event, _From, StateName, State) ->
      ?log_warning("Got unexpected sync event ~p (when in ~p):~n~p",
                   [Event, StateName, State]),
  