anchor.diff:  
   % @doc riak_ring manages a riak node's local view of partition
   %      ownership.  The functions in this module revolve around use
  -%      of the hstate record, which should be treated as opaque by
  +%      of the chstate record, which should be treated as opaque by
   %      other modules.  Riak nodes exchange instances of
   %      these records via gossip in order to converge on a common
   %      view of node/partition ownership.
  
positive.code:     {new_ring, C4} = reconcile(A3,C3),
      {new_ring, A4} = reconcile(C4,A3),
      {new_ring, B3} = reconcile(A4,B2),
      ?assertEqual(A4#hstate.ring, B3#hstate.ring),
      ?assertEqual(B3#hstate.ring, C4#hstate.ring).
  
  param_fresh_test() ->
      application:set_env(riak,ring_creation_size,4),
  
negative.code:          get_meta/2, update_meta/3]).	 
  
  % @type riak_ring(). The opaque data type used for partition ownership.
  -record(chstate, {
      nodename, % the Node responsible for this chstate
      vclock,   % for this chstate object, entries are {Node, Ctr}
      chring,   % chash ring of {IndexAsInt, Node} mappings
      meta      % dict of cluster-wide other data (primarily bucket N-value, etc)
  }). 
  
  % @type meta_entry(). Record for each entry in #chstate.meta
  -record(meta_entry, {
      value,    % The value stored under this entry
      lastmod   % The last modified time of this entry, 
                %  from calendar:datetime_to_gregorian_seconds(
                %                             calendar:universal_time()), 
  }).
  
  % @doc This is used only when this node is creating a brand new cluster.
  % @spec fresh() -> chstate()
  fresh() ->
      % use this when starting a new cluster via this node
      fresh(node()).
  
  % @doc Equivalent to fresh/0 but allows specification of the local node name.
  %      Called by fresh/0, and otherwise only intended for testing purposes.
  % @spec fresh(NodeName :: term()) -> chstate()
  fresh(NodeName) ->
      fresh(riak:get_app_env(ring_creation_size), NodeName).
  
  % @doc Equivalent to fresh/1 but allows specification of the ring size.
  %      Called by fresh/1, and otherwise only intended for testing purposes.
  % @spec fresh(RingSize :: integer(), NodeName :: term()) -> chstate()
  fresh(RingSize, NodeName) ->
      #chstate{nodename=NodeName,
  	    vclock=vclock:fresh(),
  	    chring=chash:fresh(RingSize, NodeName),
              meta=dict:new()}.
  
  % @doc Return all partition indices owned by the node executing this function.
  % @spec my_indices(State :: chstate()) -> [integer()]
  my_indices(State) ->
      [I || {I,Owner} <- ?MODULE:all_owners(State), Owner =:= node()].
  
  % @doc Return a partition index not owned by the node executing this function.
  %      If this node owns all partitions, return any index.
  % @spec random_other_index(State :: chstate()) -> integer()
  random_other_index(State) ->
      L = [I || {I,Owner} <- ?MODULE:all_owners(State), Owner =/= node()],
      case L of
  