KEYCLOAK-18518 Add expiration lifespan configuration to every distributed and replicated cache
This commit is contained in:
parent
f3a96b9da9
commit
333f77a039
5 changed files with 154 additions and 16 deletions
|
@ -757,4 +757,48 @@ if (outcome == failed) of /profile=$clusteredProfile/subsystem=infinispan/cache-
|
|||
echo
|
||||
end-if
|
||||
|
||||
# Migrate from 14.0.0 to 15.0.0
|
||||
|
||||
# Add expiration lifespan configuration to every distributed and replicated cache.
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/replicated-cache=work/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'work' replicated-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/replicated-cache=work/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'sessions' replicated-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'clientSessions' distributed-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'offlineSessions' distributed-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineClientSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'offlineClientSessions' distributed-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineClientSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'authenticationSessions' distributed-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'loginFailures' distributed-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=actionTokens/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'actionTokens' distributed-cache
|
||||
/profile=$clusteredProfile/subsystem=infinispan/cache-container=keycloak/distributed-cache=actionTokens/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
|
||||
echo *** End Migration of /profile=$clusteredProfile ***
|
||||
|
|
|
@ -888,4 +888,48 @@ if (outcome == success) && (result == "") of /subsystem=jpa:read-attribute(name=
|
|||
echo
|
||||
end-if
|
||||
|
||||
# Migrate from 14.0.0 to 15.0.0
|
||||
|
||||
# Add expiration lifespan configuration to every distributed and replicated cache.
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/replicated-cache=work/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'work' replicated-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/replicated-cache=work/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'sessions' replicated-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'clientSessions' distributed-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'offlineSessions' distributed-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineClientSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'offlineClientSessions' distributed-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineClientSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'authenticationSessions' distributed-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'loginFailures' distributed-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
if (result == undefined) of /subsystem=infinispan/cache-container=keycloak/distributed-cache=actionTokens/component=expiration/:read-attribute(name=lifespan)
|
||||
echo Setting expiration lifespan for 'actionTokens' distributed-cache
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=actionTokens/component=expiration/:write-attribute(name=lifespan,value=900000000000000000)
|
||||
echo
|
||||
end-if
|
||||
|
||||
echo *** End Migration ***
|
||||
|
|
|
@ -22,26 +22,44 @@
|
|||
<feature spec="subsystem.infinispan.cache-container.distributed-cache">
|
||||
<param name="distributed-cache" value="sessions"/>
|
||||
<param name="owners" value="1"/>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache.component.expiration">
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache">
|
||||
<param name="distributed-cache" value="authenticationSessions"/>
|
||||
<param name="owners" value="1"/>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache.component.expiration">
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache">
|
||||
<param name="distributed-cache" value="offlineSessions"/>
|
||||
<param name="owners" value="1"/>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache.component.expiration">
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache">
|
||||
<param name="distributed-cache" value="clientSessions"/>
|
||||
<param name="owners" value="1"/>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache.component.expiration">
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache">
|
||||
<param name="distributed-cache" value="offlineClientSessions"/>
|
||||
<param name="owners" value="1"/>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache.component.expiration">
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache">
|
||||
<param name="distributed-cache" value="loginFailures"/>
|
||||
<param name="owners" value="1"/>
|
||||
<feature spec="subsystem.infinispan.cache-container.distributed-cache.component.expiration">
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.local-cache">
|
||||
<param name="local-cache" value="authorization"/>
|
||||
|
@ -51,6 +69,9 @@
|
|||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.replicated-cache">
|
||||
<param name="replicated-cache" value="work"/>
|
||||
<feature spec="subsystem.infinispan.cache-container.replicated-cache.component.expiration">
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
<feature spec="subsystem.infinispan.cache-container.local-cache">
|
||||
<param name="local-cache" value="keys"/>
|
||||
|
@ -70,6 +91,7 @@
|
|||
<feature spec="subsystem.infinispan.cache-container.distributed-cache.component.expiration">
|
||||
<param name="max-idle" value="-1"/>
|
||||
<param name="interval" value="300000"/>
|
||||
<param name="lifespan" value="900000000000000000"/>
|
||||
</feature>
|
||||
</feature>
|
||||
</feature>
|
||||
|
|
|
@ -37,12 +37,24 @@
|
|||
</encoding>
|
||||
<memory storage="HEAP" max-count="10000"/>
|
||||
</local-cache>
|
||||
<distributed-cache name="sessions" owners="1"/>
|
||||
<distributed-cache name="authenticationSessions" owners="1"/>
|
||||
<distributed-cache name="offlineSessions" owners="1"/>
|
||||
<distributed-cache name="clientSessions" owners="1"/>
|
||||
<distributed-cache name="offlineClientSessions" owners="1"/>
|
||||
<distributed-cache name="loginFailures" owners="1"/>
|
||||
<distributed-cache name="sessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="authenticationSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="offlineSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="clientSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="offlineClientSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="loginFailures" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<local-cache name="authorization">
|
||||
<encoding>
|
||||
<key media-type="application/x-java-object"/>
|
||||
|
@ -50,7 +62,9 @@
|
|||
</encoding>
|
||||
<memory storage="HEAP" max-count="10000"/>
|
||||
</local-cache>
|
||||
<replicated-cache name="work"/>
|
||||
<replicated-cache name="work">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</replicated-cache>
|
||||
<local-cache name="keys">
|
||||
<encoding>
|
||||
<key media-type="application/x-java-object"/>
|
||||
|
@ -64,7 +78,7 @@
|
|||
<key media-type="application/x-java-object"/>
|
||||
<value media-type="application/x-java-object"/>
|
||||
</encoding>
|
||||
<expiration max-idle="-1" interval="300000"/>
|
||||
<expiration max-idle="-1" lifespan="900000000000000000" interval="300000"/>
|
||||
<memory storage="HEAP" max-count="-1"/>
|
||||
</distributed-cache>
|
||||
</cache-container>
|
||||
|
|
|
@ -96,23 +96,37 @@
|
|||
<local-cache name="users">
|
||||
<heap-memory size="10000"/>
|
||||
</local-cache>
|
||||
<distributed-cache name="sessions" owners="1"/>
|
||||
<distributed-cache name="authenticationSessions" owners="1"/>
|
||||
<distributed-cache name="offlineSessions" owners="1"/>
|
||||
<distributed-cache name="clientSessions" owners="1"/>
|
||||
<distributed-cache name="offlineClientSessions" owners="1"/>
|
||||
<distributed-cache name="loginFailures" owners="1"/>
|
||||
<distributed-cache name="sessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="authenticationSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="offlineSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="clientSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="offlineClientSessions" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="loginFailures" owners="1">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</distributed-cache>
|
||||
<local-cache name="authorization">
|
||||
<heap-memory size="10000"/>
|
||||
</local-cache>
|
||||
<replicated-cache name="work"/>
|
||||
<replicated-cache name="work">
|
||||
<expiration lifespan="900000000000000000"/>
|
||||
</replicated-cache>
|
||||
<local-cache name="keys">
|
||||
<heap-memory size="1000"/>
|
||||
<expiration max-idle="3600000"/>
|
||||
</local-cache>
|
||||
<distributed-cache name="actionTokens" owners="2">
|
||||
<heap-memory size="-1"/>
|
||||
<expiration max-idle="-1" interval="300000"/>
|
||||
<expiration max-idle="-1" lifespan="900000000000000000" interval="300000"/>
|
||||
</distributed-cache>
|
||||
</cache-container>
|
||||
<cache-container name="server" aliases="singleton cluster" default-cache="default" modules="org.wildfly.clustering.server">
|
||||
|
|
Loading…
Reference in a new issue