Created
July 15, 2010 01:26
-
-
Save dreverri/476365 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fun = fun(Nodes) -> | |
{ok, LocalRing} = riak_core_ring_manager:get_my_ring(), | |
LocalOwners = riak_core_ring:all_owners(LocalRing), | |
case (catch lists:foldl(fun(Node, _) -> | |
{ok, R} = rpc:call(Node, riak_core_ring_manager, get_my_ring, []), | |
true = riak_core_ring:all_owners(R) =:= LocalOwners | |
end, | |
true, | |
Nodes)) of | |
true -> true; | |
_ -> false | |
end | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used to check if nodes in a Riak cluster all have the same view of the ring (partition distribution).
Run the function on a Riak node. Pass a list of nodes and the function will compare the local node to all the nodes in the list.
Fun(['dev1@127.0.0.1','dev2@127.0.0.1']).