helenus failover

405 views
Skip to first unread message

kvir...@gmail.com

unread,
Jan 16, 2013, 12:14:33 AM1/16/13
to hel...@googlegroups.com
hi~.
I use helenus to cassandra client. while testing, I have one question.

My cassandra cluster consists of three machine(A,B and C) and RF = 2

and Helenus client connect to cassandra such below way.

var hosts = ['A:9160', 'B:9170', 'C:9170'];

var helenus = require('helenus'), pool = new helenus.ConnectionPool({
hosts : hosts,
keyspace : 'test',
timeout : 3000,
hostPoolSize : 1
});

and get

pool.connect(function(err, keyspace){
keyspace.get('data', function(err, cf){
cf.get( key , {consistency : helenus.ConsistencyLevel.ONE }, function(err, row){


});
)};
});

When machine B or C is down, get method works well. But, machine 'A' is down, below message is comming.

"{ [HelenusNoAvailableNodesException: No Available Connections] name: 'HelenusNoAvailableNodesException' }
"

Is there any solution??

Calvin French-Owen

unread,
Jan 17, 2013, 2:58:32 PM1/17/13
to kvir...@gmail.com, hel...@googlegroups.com
Haven't looked at this in a while, but when I was testing some of the fault tolerance stuff, I also observed this happening. I didn't have enough time to investigate fully, but helenus *should* run through its remaining connections. I expect it is some problem with how connections are getting cycled.

If you are only making a single call, then it is likely whichever connect you are using gets marked as dead and then calls back. I'm curious to see what happens when you make multiple calls, whether it successfully fails-over to the other connections, or whether it still returns an error.


--



Russell Bradberry

unread,
Jan 17, 2013, 3:35:36 PM1/17/13
to hel...@googlegroups.com, kvir...@gmail.com
This sounds correct, Helenus won't retry a failed command as this could make the certain queries non-idempotent.  If the query comes back as failed, it should be retried if that is what your application decides.  

Russell Bradberry

unread,
Jan 17, 2013, 3:37:57 PM1/17/13
to hel...@googlegroups.com, kvir...@gmail.com
Also, is node A your seed node?  Are you bringing node B and node C up without node A? or are you dropping node A out after all 3 have come up.  The reason is that if node A is your seed node then node B and C wont come up until they can communicate with it.
Reply all
Reply to author
Forward
0 new messages