Right now, offline sessions need to be preloaded at the server startup. This can cause some issues (JTA transaction timeout, server startup timeout, Infinispan DistributedExecutorService timeout etc). See
KEYCLOAK-7275 and KEYCLOAK-7745 .
Hopefully we can avoid to preload offline sessions at startup for example by:
- Use Infinispan CacheLoader/CacheStore. But those don't have support for querying OOTB (maybe could be somehow combined with Lucene indexes or other things...)
- Use the similar approach like for realms and users model and combine DB and infinispan ourselves. Querying will always need to delegate to DB, which is not very performant...
- Something else (Also with respect to the fact that we may add support for JDG-only model)