OF-2313: Do not depend on clustered cache when resolving cluster outage
Code that facilitates working with incoming server sessions previously depended on two caches. The 'second' cache stored 'validatedDomains' information. This comment was added:
> Content is stored in a clustered cache so that even in the case of the node hosting the sessions is lost we can still have access to this info to be able to perform proper clean up logic
We now know that in case of an incident that involves losing a cluster node, the content of caches cannot be depended on (instead, local copies of cached data needs to be maintained).
This commit removes the second cache, replacing it with a construct that keeps 'validatedDomains' info in both the primary cache, as well as locally-stored data.
OF-2311: Remove resumable state when closing remote sessions
When a cluster node closes a (client) session that lives on a different cluster node, it's is very likely that this session is never going to be resumed (XEP-0198): the other node presumably has a good reason to want to close it (eg: replacing it with another session in IQBindHandler).
This commit ensures that a session on a different cluster node does not fall in a 'resumable' state when it is closed by another cluster node.
OF-2300: Detect and recover 'lost' cache data after cluster breakage
When a cluster node drops out of a cluster, it might be unable to retrieve cache entries. This means that those cache entries are effectively lost.
To work around this, relevant caches are supported by local data structures that can be used to re-populate these caches.
This commit detects and recovers entries that is lost in caches (as described above) for all caches in SessionManager and RoutingTableImpl
Replaced term 'hostname' with 'domain' where appropriate in SessionManager
Older versions of Openfire used the term 'hostname' and 'domain' interchangebly. With clustering though, a single XMPP domain can consists of multiple servers, that each have their own hostname.
This commit replaces most references to the word 'hostname' with 'domain' in the implementation of SessionManager. No functional changes are intended.