Repository navigation
|
While reviewing startup logs and our cache configuration, we stumbled upon this line in CacheConfigurator.java: logger.infof("Setting a memory limit implies to have exactly one owner. Setting num_owners=1 to avoid data loss.", name);
builder.clustering().hash().numOwners(1);We're currently wondering what exactly is meant by this line, and how it prevents data loss. Offline Sessions are persistent in the database, even if persistent sessions are disabled, so there should never be any data loss, regardless of how infinispan is configured for offline sessions. With this setting, if the owner of an offline session goes offline, that session can no longer be fetched from cache on any of the remaining nodes in the cluster, and they all have to access it from the database. That might qualify as data loss, but then this setting is causing the data loss, not preventing it. As I understand it, when a cache entry gets evicted due to memory limit, that entry is evicted from all owners, so there should not be a "consistency" issue either? If I understand correctly, this configuration line means that if persistent sessions are disabled, Keycloak users have two choices regarding how the offline sessions are configured right now, which are either unbounded, because Can someone shed some light on why this choice was made? |
Replies: 1 comment 1 reply
|
If you have multiple owners, items might be evicted on the primary owner, but not the secondary, and that might then have stale entries due to some internal Infinispan behavior. To avoid stale secondary owners, only have a primary owner. Later versions of KC will enforce this, and you wouldn't need to configure this manually. |
If you have multiple owners, items might be evicted on the primary owner, but not the secondary, and that might then have stale entries due to some internal Infinispan behavior. To avoid stale secondary owners, only have a primary owner.
Later versions of KC will enforce this, and you wouldn't need to configure this manually.