Keycloak web GUI is down, when the db connection is lost despite the infinispan distributed cache is configured. Any ideas why?

Deployed clustered keycloak to k8s using bitnami’s helm packaged version - Helm Charts to deploy Keycloak in Kubernetes.
Keycloak version: 21.0.2

Using PostgreSQL db for the keycloak data storage and infinispan distributed cache is enabled as a cache backend (type: ispn, stack: kubernetes).

The main problem is - both keycloak admin web gui and API stop working once the connection to the database is intentionally destroyed (simulating db outage by shutting down the db server). Please note, that the cache was filled-in with the data (by browsing the keycloak web admin for some time OR making the indentical periodic requests to the API) before simulating the outage, so theoretically it shouldn’t make any new requests to the db at all.

  • Should it work that way?
  • Have any of you tested similar Disaster Recovery scenario?
  • Why the cache is not temporarily taking the main keycloak datasource role?

The infinispan distributed cache config:

<?xml version="1.0" encoding="UTF-8"?>
<infinispan
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:infinispan:config:11.0 http://www.infinispan.org/schemas/infinispan-config-11.0.xsd"
        xmlns="urn:infinispan:config:11.0">

    <cache-container name="keycloak">
        <transport lock-timeout="60000"/>
        <local-cache name="realms">
            <encoding>
                <key media-type="application/x-java-object"/>
                <value media-type="application/x-java-object"/>
            </encoding>
            <memory max-count="10000"/>
        </local-cache>
        <local-cache name="users">
            <encoding>
                <key media-type="application/x-java-object"/>