anchor.diff:              NewState = compact_next_bucket(NewState1),
               {next_state, compacting, NewState}
       end;
  +handle_info({'DOWN', MRef, _, _, _}, StateName, #state{view_compaction_inhibited_ref=MRef,
  +                                                       view_compaction_inhibited_bucket=BinBucket}=State) ->
  +    ?log_debug("Looks like vbucket mover inhibiting view compaction for for bucket \"~s\" is dead."
  +               " Canceling inhibition", [BinBucket]),
  +    {next_state, StateName, State#state{view_compaction_inhibited_ref = undefined,
  +                                        view_compaction_inhibited_bucket = undefined}};
   handle_info({'EXIT', Compactor, Reason}, compacting,
               #state{compactor_pid=Compactor,
                      buckets_to_compact=Buckets} = State) ->
  
positive.code:                 tl(Buckets)
          end,
  
      NewState0 = State#state{compactor_pid=undefined,
                              compactor_config=undefined,
                              buckets_to_compact=NewBuckets},
      case NewBuckets of
          [] ->
              ?log_debug("Finished compaction iteration."),
              {next_state, idle, schedule_next_compaction(NewState0)};
          _ ->
              {next_state, compacting, compact_next_bucket(NewState0)}
      end;
  handle_info({'EXIT', Pid, Reason}, StateName,
              #state{running_forced_compactions=Compactions} = State) ->
  
negative.code:     Name = <<Bucket/binary, $/, DDocId/binary>>,
      Compaction = #forced_compaction{type=view, name=Name},
      {reply, ok, StateName, maybe_cancel_compaction(Compaction, State)};
  handle_sync_event({inhibit_view_compaction, BinBucketName, Pid}, From, StateName,
                    #state{view_compaction_inhibited_ref = OldRef,
                           buckets_to_compact = BucketsToCompact} = State) ->
      case OldRef =/= undefined of
          true ->
              gen_server:reply(From, nack),
              {next_state, StateName, State};
          _ ->
              MRef = erlang:monitor(process, Pid),
              NewState = State#state{
                           view_compaction_inhibited_bucket = BinBucketName,
                           view_compaction_inhibited_completion_waiter = undefined,
                           view_compaction_inhibited_ref = MRef,
                           view_compaction_inhibited_final_stage = false,
                           view_compaction_inhibited_final_stage_waiter = undefined},
              case StateName =:= compacting andalso hd(BucketsToCompact) =:= BinBucketName of
                  true ->
                      NewState2 = NewState#state{
                                    view_compaction_inhibited_completion_waiter = From},
                      {next_state, StateName, NewState2};
                  false ->
                      {reply, {ok, MRef}, StateName, NewState}
              end
      end;
  handle_sync_event({uninhibit_view_compaction, BinBucketName, MRef}, From, StateName,
                    #state{view_compaction_inhibited_bucket = ABinBucketName,
                           view_compaction_inhibited_ref = AnMRef,
                           view_compaction_inhibited_final_stage = false} = State)
    when AnMRef =:= MRef andalso ABinBucketName =:= BinBucketName ->
      case StateName of
          compacting ->
              ok;
          idle ->
              self() ! compact
      end,
      {next_state, StateName, State#state{view_compaction_inhibited_final_stage_waiter = From,
                                          view_compaction_inhibited_final_stage = true}};
  handle_sync_event({uninhibit_view_compaction, _BinBucketName, _MRef} = Msg, _From, StateName, State) ->
      ?log_debug("Sending back nack on uninhibit_view_compaction: ~p, state: ~p", [Msg, State]),
      {reply, nack, StateName, State};
  handle_sync_event(Event, _From, StateName, State) ->
      ?log_warning("Got unexpected sync event ~p (when in ~p):~n~p",
                   [Event, StateName, State]),
  