[
https://issues.apache.org/jira/browse/WICKET-6356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
wayne pope updated WICKET-6356:
-------------------------------
Description:
Clustering failover with Tomcat 8 is not working for us in Production or
locally on my Mac. The reason is the following from the debugging that I did
and from the best of my understanding:
Whenever a statefull page is used/touched the SessionEntry is updated. This
SessionEntry is stored in the tomcats session under the attribute name
"wicket:persistentPageManagerData-APPLICATION_NAME".
However at the end of the wicket request, Session.internalDetach() is called
and setAttribute() is called passing the wicket session under the name
"wicket:wicket.hub:session". This triggers the replication in Tomcat (only when
setAttribute is called and ONLY that attribute is replicated). Because the
SessionEntry is stored under a different attribute name its never replicated.
The only time the SessionEntry is replicated is when a node first starts up and
joins the cluster , at this point all sessions are replicated across (including
all attritbutes) by the daltamanager and SessionEntry#readObject() is used
which contains all the pages. On Tomcat after this initial syncing of all
sessions SessionEntry#readObject() is never used.
So the only time session failover works is when you kill the other instance (in
a 2 node cluster) just after the other instance starts up - at this point the
correct SessionEntry is on the new instance. If however you visit some more
pages the new pages are never replicated across as the SessionEntry is never
replicated.
Further to this IF the SessionEntry was to be replicated it would not be any
good as the cache are transient
private transient List<IManageablePage> sessionCache;
private transient List<Object> afterReadObject
So in summary there seems there is no way for the current mechanism on Tomcat
to work. It would seem the SessionEntry.sessionCache needs to be not transient
and setAttribute needs to be called for the SessionEntry at the end of request
on the internalDetach so that Tomcats deltamanager replicates that attribute in
the session.
Attached my quickstart , tomcat, and apache conf.
was:
Clustering failover with Tomcat 8 is not working for us in Production. The
reason is the following from the debugging that I did and from the best of my
understanding:
Whenever a statefull page is used/touched the SessionEntry is updated. This
SessionEntry is stored in the tomcats session under the attribute name
"wicket:persistentPageManagerData-APPLICATION_NAME".
However at the end of the wicket request, Session.internalDetach() is called
and setAttribute() is called passing the wicket session under the name
"wicket:wicket.hub:session". This triggers the replication in Tomcat (only when
setAttribute is called and ONLY that attribute is replicated). Because the
SessionEntry is stored under a different attribute name its never replicated.
The only time the SessionEntry is replicated is when a node first starts up and
joins the cluster , at this point all sessions are replicated across (including
all attritbutes) by the daltamanager and SessionEntry#readObject() is used
which contains all the pages. On Tomcat after this initial syncing of all
sessions SessionEntry#readObject() is never used.
So the only time session failover works is when you kill the other instance (in
a 2 node cluster) just after the other instance starts up - at this point the
correct SessionEntry is on the new instance. If however you visit some more
pages the new pages are never replicated across as the SessionEntry is never
replicated.
Further to this IF the SessionEntry was to be replicated it would not be any
good as the cache are transient
private transient List<IManageablePage> sessionCache;
private transient List<Object> afterReadObject
So in summary there seems there is no way for the current mechanism on Tomcat
to work. It would seem the SessionEntry.sessionCache needs to be not transient
and setAttribute needs to be called for the SessionEntry at the end of request
on the internalDetach so that Tomcats deltamanager replicates that attribute in
the session.
Attached my quickstart , tomcat, and apache conf.
> Clustering failover not working on Tomcat
> -----------------------------------------
>
> Key: WICKET-6356
> URL: https://issues.apache.org/jira/browse/WICKET-6356
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.17.0, 7.5.0
> Environment: Tomcat 8.0.32, Apache 2.4, OSx and Solaris 9,
> Reporter: wayne pope
> Labels: cluster, clustering, tomcat
> Attachments: IssueFiles.zip
>
>
> Clustering failover with Tomcat 8 is not working for us in Production or
> locally on my Mac. The reason is the following from the debugging that I did
> and from the best of my understanding:
> Whenever a statefull page is used/touched the SessionEntry is updated. This
> SessionEntry is stored in the tomcats session under the attribute name
> "wicket:persistentPageManagerData-APPLICATION_NAME".
> However at the end of the wicket request, Session.internalDetach() is called
> and setAttribute() is called passing the wicket session under the name
> "wicket:wicket.hub:session". This triggers the replication in Tomcat (only
> when setAttribute is called and ONLY that attribute is replicated). Because
> the SessionEntry is stored under a different attribute name its never
> replicated.
> The only time the SessionEntry is replicated is when a node first starts up
> and joins the cluster , at this point all sessions are replicated across
> (including all attritbutes) by the daltamanager and SessionEntry#readObject()
> is used which contains all the pages. On Tomcat after this initial syncing of
> all sessions SessionEntry#readObject() is never used.
> So the only time session failover works is when you kill the other instance
> (in a 2 node cluster) just after the other instance starts up - at this point
> the correct SessionEntry is on the new instance. If however you visit some
> more pages the new pages are never replicated across as the SessionEntry is
> never replicated.
> Further to this IF the SessionEntry was to be replicated it would not be any
> good as the cache are transient
> private transient List<IManageablePage> sessionCache;
> private transient List<Object> afterReadObject
>
> So in summary there seems there is no way for the current mechanism on Tomcat
> to work. It would seem the SessionEntry.sessionCache needs to be not
> transient and setAttribute needs to be called for the SessionEntry at the end
> of request on the internalDetach so that Tomcats deltamanager replicates that
> attribute in the session.
> Attached my quickstart , tomcat, and apache conf.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)