On 21.08.23 21:30, Dattaram Porob wrote:
> Looks like Keycloak does not support rolling upgrades stating DB schema
> compatibility issues. But, I looked at the schema changes and tried a
> small experiment to check whether Keycloak 17 and Keycloak 21 could
> point to the same DB and it seemed to work fine.
Hmm, in this case you could start the new (14.x) instances as
non-distributed/local instances with a cache store pointing to the
shared DB. Data would be loaded into the caches as needed from the DB,
and changes would be written back to the DB.
When all 14.x instances are running, configure the 14.x instances as
distributed, and restart them one by one.
This would slow down things a bit, since the upgrade makes the system
non distributed and the DB a SPOF. However, it might work.. *if* the
schema is really compatible.
> So, I believe the biggest hurdle is the possible loss of session data
> which is held in distributed (infinispan) cache. Hence I was trying to
> see whether I can get a Keycloak 17 (infinispan 12.x) and Keycloak
> 21(infinispan 14.x) instance to share the infinispan cache which you are
> saying is not possible, since the versions are different, correct ?
I think this is what Pedro was saying. While the data might be
compatible, e.g. byte[] arrays, the commands to replicate the data might
differ. Example: a put(k,v) command in 12.x marshals to a byte[] array
that cannot be read by a 14.x instance.