The most common reason for a node to leave a cluster is shutdown for scheduled maintenance. With the increasing frequency of software updates, this is becoming more and more common and with the gorwing number of nodes in your cluster, more and more complex and error prone.
Every time a node leaves a cluster, the sessions that it is carrying will become unavailable, unless they can be evacuated to surviving nodes.
Let's take a look at WADI doing this.We start a red and green node.
When everything has settled down, create a session on red with e.g. :http://localhost:8080/wadi/session.jsp.
Shutdown red gently (i.e. ctl-c).
red will say something like this :
2005/12/07 21:24:55:568 GMT [DEBUG] Utils - -motion: 9B8858BA311C365632247E66387415BA : memory -> cluster (65 millis)
green should say e.g. :
Utils - -motion: 9B8858BA311C365632247E66387415BA : cluster -> memory (20 millis)
and the Partition Master (in this case green, because it is the only surviving node):
LocalPartition#67@green - -relocation {9B8858BA311C365632247E66387415BA : red -> green}
Note that Partitions are evacuated first and then Sessions are evacuated to their respective Partitions. This ensures that the sessions are left in the most efficient place that they can be and are scattered evenly around the surviving nodes.
In this way, WADI maintains the availability of sessions beyond the lifetime of their container.
Try creating more than one session on a node in a larger cluster and then shutting it down - you may need to restart your browser, use more than one browser, or a tool like Jakarta JMeter. You should see sessions evacuating from this node to different nodes all across the cluster.