The code you're looking for is the "should_handoff" fun in riak_core_vnode.erl: https://github.com/basho/riak_core/blob/riak_core-0.14.2/src/riak_core_vnode.erl
There is a timer in the vnodes that fires periodically, and the vnode will check it's current ring to determine if it is still the owner for the index it represents. If it's not the current owner, the vnode initiates handoff to the current owner. This design allows handoff to occur both due to ring changes (join/leave) as well as for hinted handoff (eg. when a write destined for a node was sent to a secondary node during a temporary partition/downtime, and is later handed off to the real node). -Joe On Thu, Jun 30, 2011 at 3:04 PM, Joel Meyer <joel.me...@gmail.com> wrote: > I'm trying to understand when and how data handoff between nodes is > triggered in riak_core. I was under the impression that data would be > shuffled when a new node joined the cluster or an existing node left the > cluster, but maybe that's not the case? It looks like joining a cluster is > accomplished by gossiping your ring with a node in the cluster that you wish > to join (riak_core_gossip:send_ring(NodeInCluster, node())). Looking through > the code I don't see anywhere that a partitions data is transferred once an > updated ring is agreed upon. Leaving a cluster seems to be handled > similarly, but I don't see any handoff triggered in this case either. I must > be missing something obvious? I'm looking at tag riak_core-0.14.2. > Thanks, > Joel > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com