Consider removing snapshot mode from http session replicatio
brian.stansberry Dec 5, 2005 12:59 PMDiscussion thread for JBAS-2447.
Want to open a discussion of the idea of removing the snapshot mode configuration from http session replication, and just using instant mode. This came up in a recent public clustering training Bela and I did.
Since we moved to using JBossCache, asynchronous replication can be achieved via using REPL_ASYNC in the cache. Queuing can be achieved by using a replication queue in the cache. Message bundling at the JGroups level is also available. So, having another configuration option to achieve largely the same purpose seems like overkill.
Pro's of removing this option:
1) Any exceptions thrown in the session replication layer can *potentially* be communicated to the user via an exception on the web request. Need to test this, as by the time the replication code kicks in the request response may already be committed.
2) Removes another config option.
Con's of removing this option:
1) Removes a config option some people may be accustomed to. Have to train users that REPL_ASYNC largely serves the same purpose. Because of this I wouldn't want to remove this option in the 4.0.x series, only 5x.
2) There is some local overhead associated with session replication (i.e. marshalling session data and storing in the cache). Removing "interval" mode forces the time for this operation into the request response time. This could be significant if another thread has locks on the session's cache nodes. Typically there shouldn't be lock conflicts, as only one thread would be writing to a session.
3) If we decided to communicate replication problems to the end user (by having Tomcat return a 500), some applications may not want this; i.e. they consider session replication a low priority issue and don't want users seeing errors because of this. So, we might have to add a config switch to prevent this -- and now we have another config switch :)
I started this post thinking we should get rid of "interval" mode. As I've written I've come to the opinion that we need to check if a session repl failure can be communicated to the user via an HTTP 500. If not, there is no net benefit in getting rid of the option. If so, I'd say get rid of interval mode and add a switch to configure whether session repl problems should result in a 500.