anchor.diff:                        #storage_stats{total_sizes = TotalSize,
                                        active_sizes = ActiveSize,
                                        compaction_hist = History} <- DUState]),
  -
  -            %% Check compaction status of the node
  -            case CompactionState of
  -                #compaction_stats{status = ?ST_RUNNING} ->
  -                    [{Node, ?ST_RUNNING}|Acc];
  -                #compaction_stats{status = ?ST_IDLING} ->
  -                    %% Check compaction's interval
  -                    MaxCompactionDate = lists:max(CompactionDate),
  -                    DiffCompactionDate = leo_date:now() - MaxCompactionDate,
  -                    CompactionInterval = ?env_auto_compaction_interval(),
  -
  -                    case (DiffCompactionDate >= CompactionInterval) of
  -                        true ->
  -                            %% Check fragmentation ratio
  -                            ActiveSizeRatio = erlang:round(SumActiveSize / SumTotalSize * 100),
  -                            ThresholdActiveSizeRatio = ?env_threshold_active_size_ratio(),
  -                            ActiveSizeRatioDiff = leo_math:floor(ThresholdActiveSizeRatio / 20),
  -
  -                            case (ActiveSizeRatio =< (ThresholdActiveSizeRatio + ActiveSizeRatioDiff)) of
  -                                true ->
  -                                    [{Node, ?ST_IDLING}|Acc];
  -                                false ->
  -                                    Acc
  -                            end;
  -                        false ->
  -                            Acc
  -                    end;
  -                _ ->
  -                    Acc
  -            end;
  +            {CompactionState#compaction_stats.status == ?ST_RUNNING,
  +             [#compaction_info{node = Node,
  +                               total_size = SumTotalSize,
  +                               active_size = SumActiveSize,
  +                               history = CompactionDate,
  +                               state = CompactionState}|Acc]};
           _ ->
               timer:sleep(timer:seconds(1)),
  -            is_candidate_1(Node, Acc, RetryTimes + 1)
  +            get_candidates(Node, Acc, RetryTimes + 1)
       end.
  -
  -%% @private
  -is_candidates_2(Candidates) ->
  -    lists:member({erlang:node(), ?ST_IDLING}, Candidates).
  
positive.code:                     N ->
                          N
                  end,
              is_candidates(Members, MaxNumOfNodes, []);
          _ ->
              false
      end.
  
negative.code: 
  %% @doc Retrieve candidate nodes of data-compaction
  %% @private
  is_candidates([],_,_,[]) ->
      false;
  is_candidates([],_,MaxNumOfNodes, Acc) ->
      is_candidates_1(MaxNumOfNodes, Acc);
  is_candidates(_, MaxNumOfNodes, MaxNumOfNodes, Acc) ->
      is_candidates_1(MaxNumOfNodes, Acc);
  is_candidates([#member{node = Node}|Rest], CntRunningNode, MaxNumOfNodes, Acc) ->
      {IsRunning, Acc_1} = get_candidates(Node, Acc, 0),
      CntRunningNode_1 = case IsRunning of
                             true ->
                                 CntRunningNode + 1;
                             false ->
                                 CntRunningNode
                         end,
      is_candidates(Rest, CntRunningNode_1, MaxNumOfNodes, Acc_1).
  
  %% @private
  is_candidates_1(MaxNumOfNodes, Candidates) ->
      %% Count running nodes
      RunningNodes = length([_N || #compaction_info{
                                     node = _N,
                                     state = ?ST_RUNNING} <- Candidates]),
      case (RunningNodes >= MaxNumOfNodes) of
          true ->
              false;
          false ->
              %% Retrieve cadidates
              case (MaxNumOfNodes - RunningNodes) of
                  0 ->
                      false;
                  MaxNumOfNodes_1 when MaxNumOfNodes_1 < 0->
                      false;
                  MaxNumOfNodes_1 ->
                      Candidates_1 = is_candidates_2(Candidates, []),
                      Candidates_2 = lists:sort([{History, Node} ||
                                                    #compaction_info{node = Node,
                                                                     history = History}
                                                        <- Candidates_1]),
                      lists:member(erlang:node(),
                                   [Node_1 ||
                                       {_History, Node_1}
                                           <- lists:sublist(Candidates_2,
                                                            MaxNumOfNodes_1)])
              end
      end.
  
  %% @private
  is_candidates_2([], Acc) ->
      Acc;
  is_candidates_2([#compaction_info{state = #compaction_stats{status = ?ST_RUNNING}}|Rest], Acc) ->
      is_candidates_2(Rest, Acc);
  is_candidates_2([#compaction_info{total_size = SumTotalSize,
                                    active_size = SumActiveSize,
                                    history = CompactionDate,
                                    state = #compaction_stats{status = ?ST_IDLING}
                                   } = CompactionInfo|Rest], Acc) ->
      %% Check a comapction-interval of the node
      MaxCompactionDate = lists:max(CompactionDate),
      DiffCompactionDate = leo_date:now() - MaxCompactionDate,
      CompactionInterval = ?env_auto_compaction_interval(),
      Acc_1 = case (DiffCompactionDate >= CompactionInterval) of
                  true ->
                      %% Check a fragmentation ratio
                      ActiveSizeRatio = erlang:round(SumActiveSize / SumTotalSize * 100),
                      ThresholdActiveSizeRatio = ?env_threshold_active_size_ratio(),
                      case (ActiveSizeRatio =< ThresholdActiveSizeRatio) of
                          true ->
                              [CompactionInfo|Acc];
                          false ->
                              Acc
                      end;
                  false ->
                      Acc
              end,
      is_candidates_2(Rest, Acc_1).
  
  
  %% @private
  get_candidates(_,Acc, ?RETRY_TIMES) ->
      Acc;
  get_candidates(Node, Acc, RetryTimes) ->
      case rpc:call(Node, leo_object_storage_api,
                    du_and_compaction_stats, [], ?DEF_REQ_TIMEOUT) of
          {ok, []} ->
  