anchor.diff:  -export([report_node_failure/1, report_node_recovery/1,
       set_nodes_assigned_per_label/1, get_nodes_assigned_per_label/0]).
   %% Cluster reconfiguration API
  --export([init_cluster_reconfiguration/1, finish_cluster_reconfiguration/1,
  -    get_reconfiguration_nodes/0, get_reconfigured_routing_info/1]).
  +-export([init_cluster_reconfiguration/1, finish_cluster_reconfiguration/0,
  +    get_all_ring_nodes/0, get_reconfigured_routing_info/1]).
   %% Export for internal rpc usage
  --export([set_ring/2, finish_cluster_reconfiguration/0]).
  +-export([set_ring/2, finish_cluster_reconfiguration_internal/0]).
   %% Export for tests
  --export([replicate_ring_to_nodes/1, replicate_ring_to_nodes/3]).
  +-export([init_ring/2, replicate_ring_to_nodes/1, replicate_ring_to_nodes/3]).
   
   -define(RING_ENV, consistent_hashing_ring).
   -define(RECONFIGURATION_RING_ENV, reconfiguration_consistent_hashing_ring).
  +-define(TMP_RING, tmp_ring). % ring used to swap two other rings
   
   %%%===================================================================
   %%% Basic API
  
positive.code: -spec init_ring([node()], pos_integer()) -> ring().
  init_ring([_] = Nodes, NodesAssignedPerLabel) ->
      #ring{nodes_assigned_per_label = NodesAssignedPerLabel, all_nodes = Nodes};
  init_ring(Nodes, NodesAssignedPerLabel) ->
      NodeCount = length(Nodes),
      [Node0 | _] = Nodes,
      InitialCHash = chash:fresh(NodeCount, Node0),
  
negative.code:             error(Error)
      end.
  
  -spec get_all_nodes_no_error(ring_name()) -> [node()].
  get_all_nodes_no_error(RingName) ->
      case get_ring(RingName) of
          #ring{all_nodes = AllNodes} ->
              AllNodes;
          {error, _} ->
              []
      end.
  
  -spec finish_cluster_reconfiguration_internal() -> ok.
  finish_cluster_reconfiguration_internal() ->
      Ring = get_ring(),
      NewRing = get_ring(?RECONFIGURATION_RING_ENV),
      set_ring(?TMP_RING, Ring),
      set_ring(NewRing),
      % Remember old ring
      set_ring(?RECONFIGURATION_RING_ENV, Ring),
      ctool:unset_env(?TMP_RING).