mauriciorodrigues / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

Nonsticky-session support: Store sessions in two memcached nodes to prevent a SPOF #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
With sticky-sessions sessions are stored both in tomcat and in memcached, so 
there's no SPOF. With nonsticky-sessions sessions are no longer stored in 
tomcat permanently (only for the duration of a request), so another solution 
for SPOF-prevention is needed.

The simplest solution would be to store each session in another (secondary) 
memcached node. This node could be the next node from the memcached nodes 
definition.

The failoverNodes setting does not make sense with nonsticky-sessions, if used 
this should be reported as a warning or should be prevented at all.

Original issue reported on code.google.com by martin.grotzke on 30 Dec 2010 at 2:38

GoogleCodeExporter commented 8 years ago
It would also be an option to store the secondary node id in the msm session.

Original comment by martin.grotzke on 2 Jan 2011 at 3:02

GoogleCodeExporter commented 8 years ago
Implemented in non-sticky sessions branch.

The session is now saved in a secondary memcached node using the previously 
serialized session data (so that serialization is only done once). Also the 
additional validity information is stored in the secondary memcached for 
backup. When the original/primary memcached is not available the session is 
loaded from the secondary/backup node, the clients receives a new cookie and 
the session is stored in a new primary memcached node.

Original comment by martin.grotzke on 24 Jan 2011 at 11:24

GoogleCodeExporter commented 8 years ago

Original comment by martin.grotzke on 27 Jan 2011 at 10:34