anchor.diff:                  register_forced_compaction(Pid, Compaction, State)
           end,
       {reply, ok, StateName, NewState};
  +handle_sync_event({cancel_forced_bucket_compaction, Bucket}, _From,
  +                  StateName, State) ->
  +    Compaction = #forced_compaction{type=bucket, name=Bucket},
  +    {reply, ok, StateName, maybe_cancel_compaction(Compaction, State)};
  +handle_sync_event({cancel_forced_db_compaction, Bucket}, _From,
  +                  StateName, State) ->
  +    Compaction = #forced_compaction{type=db, name=Bucket},
  +    {reply, ok, StateName, maybe_cancel_compaction(Compaction, State)};
  +handle_sync_event({cancel_forced_view_compaction, Bucket, DDocId},
  +                  _From, StateName, State) ->
  +    Name = <<Bucket/binary, $/, DDocId/binary>>,
  +    Compaction = #forced_compaction{type=view, name=Name},
  +    {reply, ok, StateName, maybe_cancel_compaction(Compaction, State)};
   handle_sync_event(Event, _From, StateName, State) ->
       ?log_warning("Got unexpected sync event ~p (when in ~p):~n~p",
                    [Event, StateName, State]),
  
positive.code:         Failed ->
              ale:error(?USER_LOGGER,
                        "Failed to start index compaction "
                        "for `~s/~s` on some nodes: ~n~p",
                        [Bucket, DDocId, Failed])
      end,
  
negative.code: is_already_being_compacted(Compaction,
                             #state{running_forced_compactions=Compactions}) ->
      dict:find(Compaction, Compactions) =/= error.
  
  -spec maybe_cancel_compaction(#forced_compaction{}, #state{}) -> #state{}.
  maybe_cancel_compaction(Compaction,
                          #state{forced_compaction_pids=CompactionPids} = State) ->
      case dict:find(Compaction, CompactionPids) of
          error ->
              State;
          {ok, Pid} ->
              exit(Pid, shutdown),
              receive
                  %% let all the other exit messages be handled by corresponding
                  %% handle_info clause so that error message is logged
                  {'EXIT', Pid, shutdown} ->
                      unregister_forced_compaction(Pid, State);
                  {'EXIT', Pid, _Reason} = Exit ->
                      {next_state, ignored, NewState} = handle_info(Exit,
                                                                    ignored, State),
                      NewState
              end
      end.
  