anchor.diff:      case get_chash_ring() of
           undefined ->
               error(chash_ring_not_initialized);
  -        Node when ?IS_SINGLE_NODE_CHASH(Node) ->
  +        #ring{type = single_node, chash = Node} ->
               Node;
  -        CHash ->
  +        #ring{type = multi_node, chash = CHash} ->
               Index = chash:key_of(Label),
               [{_, BestNode}] = chash:successors(Index, CHash, 1),
  -            BestNode
  +            BestNode;
  +        #ring{type = broken, chash = CHash, broken_nodes = BrokenNodes} ->
  +            Index = chash:key_of(Label),
  +            [{_, BestNode}] = chash:successors(Index, CHash, 1),
  +            case lists:member(BestNode, BrokenNodes) of
  +                true -> throw(broken_node);
  +                false -> BestNode
  +            end
       end.
   
   %%--------------------------------------------------------------------
  
positive.code: %% Returns consistent hashing ring.
  %% @end
  %%--------------------------------------------------------------------
  -spec get_chash_ring() -> chash() | undefined.
  get_chash_ring() ->
      ctool:get_env(chash, undefined).
  
  
negative.code:     case get_chash_ring() of
          undefined ->
              error(chash_ring_not_initialized);
          #ring{type = single_node, chash = Node} ->
              [Node];
          #ring{type = multi_node, chash = CHash} ->
              Index = chash:key_of(Label),
              lists:map(fun({_, Node}) -> Node end, chash:successors(Index, CHash, NodesNum));
          #ring{type = broken, chash = CHash, broken_nodes = BrokenNodes} ->
              Index = chash:key_of(Label),
              lists:map(fun({_, Node}) ->
                  case lists:member(Node, BrokenNodes) of
                      true -> throw(broken_node);
                      false -> Node
                  end
              end, chash:successors(Index, CHash, NodesNum))
      end.
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Get nodes that are responsible for the data labeled with given term.
  %% Returns two lists: alvie and broken nodes.
  %% @end
  %%--------------------------------------------------------------------
  -spec get_alive_and_broken_nodes(term(), non_neg_integer()) -> {AliveNodes :: [node()], BrokenNodes :: [node()]}.
  get_alive_and_broken_nodes(Label, NodesNum) ->
      case get_chash_ring() of
          undefined ->
              error(chash_ring_not_initialized);
          #ring{type = single_node, chash = Node} ->
              {[Node], []};
          #ring{type = multi_node, chash = CHash} ->
              Index = chash:key_of(Label),
              Nodes = lists:map(fun({_, Node}) -> Node end, chash:successors(Index, CHash, NodesNum)),
              {Nodes, []};
          #ring{type = broken, chash = CHash, broken_nodes = BrokenNodes} ->
              Index = chash:key_of(Label),
              Nodes = chash:successors(Index, CHash, NodesNum),
              filter_nodes(Nodes, BrokenNodes)
      end.
  
  %%--------------------------------------------------------------------
  