anchor.diff:          Failed ->
               ale:error(?USER_LOGGER,
                         "Failed to start index compaction "
  +                      "for `~s/~s` on some nodes: ~n~p",
  +                      [Bucket, DDocId, Failed])
  +    end,
  +
  +    ok.
  +
  +cancel_forced_bucket_compaction(Bucket) ->
  +    BucketBin = list_to_binary(Bucket),
  +    R = multi_sync_send_all_state_event({cancel_forced_bucket_compaction, BucketBin}),
  +
  +    case R of
  +        [] ->
  +            ok;
  +        Failed ->
  +            ale:error(?USER_LOGGER,
  +                      "Failed to cancel bucket compaction "
  +                      "for `~s` on some nodes: ~n~p", [Bucket, Failed])
  +    end,
  +
  +    ok.
  +
  +cancel_forced_db_compaction(Bucket) ->
  +    BucketBin = list_to_binary(Bucket),
  +    R = multi_sync_send_all_state_event({cancel_forced_db_compaction, BucketBin}),
  +
  +    case R of
  +        [] ->
  +            ok;
  +        Failed ->
  +            ale:error(?USER_LOGGER,
  +                      "Failed to cancel bucket databases compaction "
  +                      "for `~s` on some nodes: ~n~p", [Bucket, Failed])
  +    end,
  +
  +    ok.
  +
  +cancel_forced_view_compaction(Bucket, DDocId) ->
  +    BucketBin = list_to_binary(Bucket),
  +    DDocIdBin = list_to_binary(DDocId),
  +    R = multi_sync_send_all_state_event(
  +          {cancel_forced_view_compaction, BucketBin, DDocIdBin}),
  +
  +    case R of
  +        [] ->
  +            ok;
  +        Failed ->
  +            ale:error(?USER_LOGGER,
  +                      "Failed to cancel index compaction "
                         "for `~s/~s` on some nodes: ~n~p",
                         [Bucket, DDocId, Failed])
       end,
  
positive.code: %% API
  -export([start_link/0,
  
           force_compact_bucket/1,
           force_compact_db_files/1, force_compact_view/2]).
  
  %% gen_fsm callbacks
  -export([init/1, handle_event/3, handle_sync_event/4, handle_info/3,
  
negative.code:                 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]),
  