Couchbase Session Management Failover Issue

We have recently integrated MemcachedBackupSessionManager with our application for storing sessions in couchbase inmemory db.

We are facing issues during Couchbase Node Failover. We have configured three couchbase nodes and clustered them together with a replica factor of 2. Every thing works fine if all nodes in the cluster are active.

But When one of the couchbase node in the cluster goes down. Our web application waits for around 3 minutes to continue with the same session from the next active nodes in the cluster
some times application gets timed out unable to get the sessions from the other active nodes from cluster.

I can explain the scenario in detail. For example when a user logs in to a shopping site and adds some products in the cart and if one node in the cluster goes down during checkout. the applications keeps waiting for around 3 to 5 minutes to get the sessions from the other active nodes in the couchbase cluster. some times web application is not able to get the sessions even after 5 minutes and gets timed out. In this case the user needs to login again and add the products to the cart

Will Couchbase handle automatic session failover when one node goes down?

Context XML config:

Is there anything i have missed out in my configuration for handling session fail over

Requesting your support at the earliest

Hi Raju, Just wanted clarify that you’re using 'in-memory" bucket i.e. Memcached for your application. If that’s correct then you can read-up on the supported capabilities for Memcached bucket. In short rebalance, failover, intra-replication and cross datacenter-replication are not supported for Memcached bucket. You should consider using Couchbase bucket in which case you get the in-memory capabilities and also availability and disaster recovery.

Thanks!

Anil Kumar

Hi Anil,

We tried using couchbase bucket and now failover/replication is working fine. But I under stand that the documents in couchbase are distributed among the nodes. for example if there are 4 nodes then the document will be splited 25% in each of the nodes. During a node failover we could see that application takes around >60 seconds to get the document from the failed node(i undersood since rebalancing is happening for recovering the data from failed over nodes to the other node). Since our use case is session data which is very critical the user cannot do any operations during rebalance.

It would be greatful if we can get the session data from the replica node quickly if a node goes down. Also does couchbase provide any pugin for handling tomcat sessions. right now we are using third party plugin for managing sessions as below