Hi Massimilliano, The list of nodes does not imply an order of connection. Usually, a random node is chosen after nodes with error rates greater than a threshold are removed from the candidates. You can see the implementation in RiakClient._choose_node: https://github.com/basho/riak-python-client/blob/master/riak/client/__init__.py#L278
When a request fails such that the connection is known to be bad (such as a TCP error), the retry logic filters out that node from existing connections. I believe it may still be possible for the node to be selected if no other connections are available in the pool, because the logic used to establish a new connection might not use the filter. I will investigate further and determine if this is actually the case. On Sat, Feb 8, 2014 at 1:03 PM, Massimiliano Ciancio < massimili...@ciancio.net> wrote: > Hi all, > I'm using python client to connect to a five nodes riak server. > Since I'm running my app on the same servers on which is running Riak, > I want that the app on server x get and store data asking to the Riak > on the same server. If the Riak on the same server is not available, > tha app must connect to another Riak server randomly choosed. > How can I implement this? > Does the list of nodes passed to the RiakClient > (http://basho.github.io/riak-python-client/client.html) imply an > 'order of connection' ? That is, first connect to the first node then, > if this fails, connect to the second and so on... > Thanks in advance > Massimiliano > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > -- Sean Cribbs <s...@basho.com> Software Engineer Basho Technologies, Inc. http://basho.com/
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com