Riak Core Question

David Dawson david.dawson at gmail.com
Tue May 3 15:06:57 EDT 2011


I have a quick question regarding riak_core:

	Basically I am trying to build an application on top of riak_core that allows me to spawn a session per user interaction, so I can both hold state and queue requests to ensure ( as best I can ) that a user will only be interacting with my system in a serialised manner.

	My understandings are as follows with riak_core:

	1. You obtain a list of possible vnodes that can serve your request based on a hash of a key which in my case is a user_id
	2. You then use each of the vnodes in the list to execute your request which in my case is 1 as I have N=1.

	In my situation I want to kill a node ( simulate a failure ) send some further long running requests in that whose primary node is the one that has been killed, and then bring back up the dead node and send some more requests in with the safe knowledge that I will not end up with 2 vnodes  (  primary  and fallback ) that are processing the requests at the same time. Has anyone got any suggestions how I may achieve this? as I have scoured the riak_core source code and can not find a way to test if a vnode is present on a primary and fallback node at the same time, or am I barking up the wrong tree and trying to achieve the unachievable.

	Also I know I can not protect from a spit brain using this approach, although this is okay as under these rare occasions I have plans to deal with this in the business logic of the App.


Dave



More information about the riak-users mailing list