Initialize Cluster with list of up node

30 views
Skip to first unread message

James Scott

unread,
Apr 9, 2013, 1:30:22 PM4/9/13
to sca...@googlegroups.com
Hi,

When initialize a Cluster by using this constructor

Cluster(String nodes, IConnection.Config connectionConfig, boolean dynamicNodeDiscovery)

a list of nodes should be provided as parameter, and enable dynamicNodeDiscovery would ignore the nodes which does not exist in the cluster.

Is that possible to initialize a Cluster object  which would ignore the nodes which are down but still in the cluster in order to avoid making connection to them?

I am considering using NodeFilter to filter our down node, is this the right way to do that?

Thanks

Dan Washusen

unread,
Apr 9, 2013, 5:08:20 PM4/9/13
to sca...@googlegroups.com
Hi James,
If you're using the default CommonsBackedPool then Pelops will automatically suspend a node for a configured period of time (10 seconds by default) when it detects a transport exception (see https://github.com/s7/scale7-pelops/blob/master/src/main/java/org/scale7/cassandra/pelops/pool/CommonsBackedPool.java#L680). After the configured period the node is reinstated (even if it's still down) and the process starts again. The down side is that when a downed node is re-instated it isn't suspended again until a transport exception is seen again which can result in some of your queries to taking longer than others while the suspension and retry logic kicks in. The simplest approach would be to increase the configured period to say 5 minutes...

Using NodeFilter would be one way of filtering out the node so that this doesn't happen. Another approach would be to provide a custom INodeSuspensionStrategy (see https://github.com/s7/scale7-pelops/blob/master/src/main/java/org/scale7/cassandra/pelops/pool/CommonsBackedPool.java#L1017) to the pool.

Hope that helps.

Regards,
Dan


--
You received this message because you are subscribed to the Google Groups "Scale 7 - Libraries and systems for scalable computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scale7+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Dan Washusen
Make big files fly!

James Scott

unread,
Apr 9, 2013, 9:06:39 PM4/9/13
to sca...@googlegroups.com
Hi Daniel,

Thanks for your reply!

As I understand CommonsBackedPool will suspend a node once a TTransportException is detected when using Mutator, Selector or RowDeletor, and after configured period it will run the retry logic with the suspended node to reinstate it.

I just want to understand the behavior of Pelops. I have wrote a test program which only create Pelops cluster and pool which have downed node in the ring, and no TTransportException is threw. That means a downed node can only be detected and suspended if Mutator, Selector or RowDeletor is used, right? 

Thanks,
James

Dan Washusen

unread,
Apr 9, 2013, 9:54:35 PM4/9/13
to sca...@googlegroups.com
Off the top of my head I'm not really sure what would happen if all the provided nodes were down. At a guess I'd expect to see NoConnectionsAvailableException("Failed to get a connection within the configured max wait time.") along with a bunch of log messages about TTransportException.

I'd also expect the TTransportException to be logged (not thrown) while the pool is trying to create a connection to the downed node. See https://github.com/s7/scale7-pelops/blob/master/src/main/java/org/scale7/cassandra/pelops/pool/CommonsBackedPool.java#L333
Reply all
Reply to author
Forward
0 new messages