Update Infinispan version to 14.0.2.Final
This commit is contained in:
parent
36ebf9dd46
commit
5e891951f5
13 changed files with 46 additions and 184 deletions
|
@ -1,6 +1,6 @@
|
|||
<config xmlns="urn:org:jgroups"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups-4.2.xsd">
|
||||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups-5.2.xsd">
|
||||
<!-- This file has been adpoted from https://github.com/infinispan/infinispan/blob/master/core/src/main/resources/default-configs/default-jgroups-udp.xml -->
|
||||
<!-- jgroups.udp.address is deprecated and will be removed, see ISPN-11867 -->
|
||||
<UDP bind_addr="${jgroups.bind.address,jgroups.udp.address:127.0.0.1}"
|
||||
|
@ -14,24 +14,23 @@
|
|||
mcast_recv_buf_size="25m"
|
||||
ip_ttl="${jgroups.ip_ttl:2}"
|
||||
thread_naming_pattern="pl"
|
||||
enable_diagnostics="false"
|
||||
bundler_type="no-bundler"
|
||||
max_bundle_size="8500"
|
||||
diag.enabled="${jgroups.diag.enabled:false}"
|
||||
bundler_type="transfer-queue"
|
||||
bundler.max_size="${jgroups.bundler.max_size:64000}"
|
||||
|
||||
thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
|
||||
thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
|
||||
thread_pool.keep_alive_time="60000"
|
||||
|
||||
thread_pool.thread_dumps_threshold="${jgroups.thread_dumps_threshold:10000}"
|
||||
/>
|
||||
<RED/>
|
||||
<PING num_discovery_runs="3"/>
|
||||
<MERGE3 min_interval="10000"
|
||||
max_interval="30000"
|
||||
/>
|
||||
<FD_SOCK/>
|
||||
<!-- Suspect node `timeout` to `timeout + timeout_check_interval` millis after the last heartbeat -->
|
||||
<FD_ALL timeout="10000"
|
||||
interval="2000"
|
||||
timeout_check_interval="1000"
|
||||
/>
|
||||
<FD_SOCK2 offset="${jgroups.fd.port-offset:50000}"/>
|
||||
<FD_ALL3/>
|
||||
<VERIFY_SUSPECT timeout="1000"/>
|
||||
<pbcast.NAKACK2 xmit_interval="100"
|
||||
xmit_table_num_rows="50"
|
||||
|
@ -44,18 +43,17 @@
|
|||
xmit_table_msgs_per_row="1024"
|
||||
xmit_table_max_compaction_time="30000"
|
||||
/>
|
||||
<pbcast.STABLE stability_delay="500"
|
||||
desired_avg_gossip="5000"
|
||||
<pbcast.STABLE desired_avg_gossip="5000"
|
||||
max_bytes="1M"
|
||||
/>
|
||||
<pbcast.GMS print_local_addr="false"
|
||||
join_timeout="${jgroups.join_timeout:500}"
|
||||
/>
|
||||
<UFC max_credits="4m"
|
||||
<UFC max_credits="${jgroups.max_credits:4m}"
|
||||
min_threshold="0.40"
|
||||
/>
|
||||
<MFC max_credits="4m"
|
||||
<MFC max_credits="${jgroups.max_credits:4m}"
|
||||
min_threshold="0.40"
|
||||
/>
|
||||
<FRAG3 frag_size="8000"/>
|
||||
<FRAG4 frag_size="${jgroups.frag_size:60000}"/>
|
||||
</config>
|
||||
|
|
|
@ -31,8 +31,6 @@ import org.infinispan.configuration.cache.ConfigurationBuilder;
|
|||
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
|
||||
import org.infinispan.manager.DefaultCacheManager;
|
||||
import org.infinispan.manager.EmbeddedCacheManager;
|
||||
import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
|
||||
import org.jgroups.JChannel;
|
||||
import org.junit.Ignore;
|
||||
import org.keycloak.common.util.Time;
|
||||
import org.keycloak.connections.infinispan.InfinispanConnectionProvider;
|
||||
|
@ -120,9 +118,6 @@ public class DistributedCacheConcurrentWritesTest {
|
|||
long took = System.currentTimeMillis() - start;
|
||||
|
||||
System.out.println("Test finished. Took: " + took + " ms. Cache size: " + cache1.size());
|
||||
|
||||
// JGroups statistics
|
||||
printStats(cache1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -232,18 +227,4 @@ public class DistributedCacheConcurrentWritesTest {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static void printStats(BasicCache cache) {
|
||||
if (cache instanceof Cache) {
|
||||
Cache cache1 = (Cache) cache;
|
||||
|
||||
JChannel channel = ((JGroupsTransport)cache1.getAdvancedCache().getRpcManager().getTransport()).getChannel();
|
||||
|
||||
System.out.println("Sent MB: " + channel.getSentBytes() / 1000000 + ", sent messages: " + channel.getSentMessages() + ", received MB: " + channel.getReceivedBytes() / 1000000 +
|
||||
", received messages: " + channel.getReceivedMessages());
|
||||
} else {
|
||||
Map<String, String> stats = ((RemoteCache) cache).stats().getStatsMap();
|
||||
System.out.println("Stats: " + stats);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,12 @@ import org.infinispan.Cache;
|
|||
import org.infinispan.configuration.cache.CacheMode;
|
||||
import org.infinispan.configuration.cache.Configuration;
|
||||
import org.infinispan.configuration.cache.ConfigurationBuilder;
|
||||
import org.infinispan.configuration.cache.VersioningScheme;
|
||||
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
|
||||
import org.infinispan.manager.DefaultCacheManager;
|
||||
import org.infinispan.manager.EmbeddedCacheManager;
|
||||
import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
|
||||
import org.infinispan.transaction.LockingMode;
|
||||
import org.infinispan.transaction.lookup.EmbeddedTransactionManagerLookup;
|
||||
import org.infinispan.util.concurrent.IsolationLevel;
|
||||
import org.jgroups.JChannel;
|
||||
import org.keycloak.common.util.Time;
|
||||
import org.keycloak.connections.infinispan.InfinispanConnectionProvider;
|
||||
import org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity;
|
||||
|
@ -98,11 +95,6 @@ public class DistributedCacheWriteSkewTest {
|
|||
session = cache1.get("123");
|
||||
System.out.println("Took: " + took + " ms. Notes count: " + session.getNotes().size() + ", failedReplaceCounter: " + failedReplaceCounter.get());
|
||||
|
||||
// JGroups statistics
|
||||
JChannel channel = (JChannel)((JGroupsTransport)cache1.getAdvancedCache().getRpcManager().getTransport()).getChannel();
|
||||
System.out.println("Sent MB: " + channel.getSentBytes() / 1000000 + ", sent messages: " + channel.getSentMessages() + ", received MB: " + channel.getReceivedBytes() / 1000000 +
|
||||
", received messages: " + channel.getReceivedMessages());
|
||||
|
||||
// Kill JVM
|
||||
cache1.stop();
|
||||
cache2.stop();
|
||||
|
|
|
@ -13,6 +13,12 @@
|
|||
<name>Keycloak Model Hot Rod</name>
|
||||
<description/>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.release>11</maven.compiler.release>
|
||||
<!-- overriding compiler plugin version as default 3.8.1-jboss-1 can't find multiple packages when building with java 11 -->
|
||||
<version.compiler.plugin>3.8.1</version.compiler.plugin>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
|
@ -59,6 +65,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${version.compiler.plugin}</version>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
|
@ -71,11 +78,6 @@
|
|||
<artifactId>keycloak-model-build-processor</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>${javax.annotation-api.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<annotationProcessors>
|
||||
<annotationProcessor>org.infinispan.protostream.annotations.impl.processor.AutoProtoSchemaBuilderAnnotationProcessor</annotationProcessor>
|
||||
|
|
5
pom.xml
5
pom.xml
|
@ -81,9 +81,8 @@
|
|||
<jakarta.persistence.version>2.2.3</jakarta.persistence.version>
|
||||
<hibernate.core.version>5.6.10.Final</hibernate.core.version>
|
||||
<hibernate.c3p0.version>5.6.10.Final</hibernate.c3p0.version>
|
||||
<infinispan.version>13.0.10.Final</infinispan.version>
|
||||
<infinispan.protostream.processor.version>4.4.1.Final</infinispan.protostream.processor.version>
|
||||
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
|
||||
<infinispan.version>14.0.2.Final</infinispan.version>
|
||||
<infinispan.protostream.processor.version>4.5.0.Final</infinispan.protostream.processor.version>
|
||||
<jackson.version>2.13.4</jackson.version>
|
||||
<jackson.databind.version>2.13.4.2</jackson.databind.version>
|
||||
<jackson.annotations.version>${jackson.version}</jackson.annotations.version>
|
||||
|
|
|
@ -17,10 +17,13 @@
|
|||
|
||||
package org.keycloak.it.cli.dist;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.EnabledOnOs;
|
||||
import org.junit.jupiter.api.condition.OS;
|
||||
|
@ -103,7 +106,7 @@ public class ClusterConfigDistTest {
|
|||
@Launch({ "start-dev", "--cache-config-file=cache-ispn-asym-enc.xml" })
|
||||
void testCustomCacheStackInConfigFile(LaunchResult result) {
|
||||
CLIResult cliResult = (CLIResult) result;
|
||||
assertTrue(cliResult.getOutput().contains("ERROR: server.jks"));
|
||||
assertThat(cliResult.getOutput(), Matchers.containsString("ISPN000078: Starting JGroups channel `ISPN` with stack `encrypt-udp`"));
|
||||
}
|
||||
|
||||
public static class ConfigureCacheUsingAsyncEncryption implements Consumer<KeycloakDistribution> {
|
||||
|
|
|
@ -23,17 +23,13 @@
|
|||
|
||||
<jgroups>
|
||||
<stack name="encrypt-udp" extends="udp">
|
||||
<SSL_KEY_EXCHANGE keystore_name="server.jks"
|
||||
keystore_password="password"
|
||||
stack.combine="INSERT_AFTER"
|
||||
stack.position="VERIFY_SUSPECT"/>
|
||||
<ASYM_ENCRYPT asym_keylength="2048"
|
||||
asym_algorithm="RSA"
|
||||
change_key_on_coord_leave = "false"
|
||||
change_key_on_leave = "false"
|
||||
use_external_key_exchange = "true"
|
||||
stack.combine="INSERT_BEFORE"
|
||||
stack.position="pbcast.NAKACK2"/>
|
||||
<SSL_KEY_EXCHANGE keystore_name="server.jks"
|
||||
keystore_password="password"/>
|
||||
<ASYM_ENCRYPT asym_keylength="2048"
|
||||
asym_algorithm="RSA"
|
||||
change_key_on_coord_leave = "false"
|
||||
change_key_on_leave = "false"
|
||||
use_external_key_exchange="true"/>
|
||||
</stack>
|
||||
</jgroups>
|
||||
|
||||
|
|
|
@ -33,14 +33,11 @@ import javax.ws.rs.Produces;
|
|||
|
||||
import org.infinispan.Cache;
|
||||
import org.infinispan.client.hotrod.RemoteCache;
|
||||
import org.infinispan.remoting.transport.Transport;
|
||||
import org.jgroups.JChannel;
|
||||
import org.keycloak.connections.infinispan.InfinispanConnectionProvider;
|
||||
import org.keycloak.models.KeycloakSession;
|
||||
import org.keycloak.models.sessions.infinispan.changes.SessionEntityWrapper;
|
||||
import org.keycloak.models.sessions.infinispan.entities.UserSessionEntity;
|
||||
import org.keycloak.connections.infinispan.InfinispanUtil;
|
||||
import org.keycloak.testsuite.rest.representation.JGroupsStats;
|
||||
import org.keycloak.utils.MediaType;
|
||||
import org.infinispan.stream.CacheCollectors;
|
||||
|
||||
|
@ -113,26 +110,6 @@ public class TestCacheResource {
|
|||
cache.getAdvancedCache().getExpirationManager().processExpiration();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/jgroups-stats")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public JGroupsStats getJgroupsStats() {
|
||||
Transport transport = cache.getCacheManager().getTransport();
|
||||
if (transport == null) {
|
||||
return new JGroupsStats(0, 0, 0, 0);
|
||||
} else {
|
||||
try {
|
||||
// Need to use reflection due some incompatibilities between ispn 8.2.6 and 9.0.1
|
||||
JChannel channel = (JChannel) transport.getClass().getMethod("getChannel").invoke(transport);
|
||||
|
||||
return new JGroupsStats(channel.getSentBytes(), channel.getSentMessages(), channel.getReceivedBytes(), channel.getReceivedMessages());
|
||||
} catch (Exception nsme) {
|
||||
throw new RuntimeException(nsme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/remote-cache-stats")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package org.keycloak.testsuite.client.resources;
|
||||
|
||||
import org.keycloak.testsuite.rest.representation.JGroupsStats;
|
||||
import org.keycloak.testsuite.rest.representation.RemoteCacheStats;
|
||||
import org.keycloak.utils.MediaType;
|
||||
|
||||
|
@ -75,11 +74,6 @@ public interface TestingCacheResource {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
void processExpiration();
|
||||
|
||||
@GET
|
||||
@Path("/jgroups-stats")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
JGroupsStats getJgroupsStats();
|
||||
|
||||
@GET
|
||||
@Path("/remote-cache-stats")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
||||
* and other contributors as indicated by the @author tags.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.keycloak.testsuite.cluster;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.ContainerController;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
import org.junit.Before;
|
||||
import org.keycloak.connections.infinispan.InfinispanConnectionProvider;
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
import org.keycloak.testsuite.Assert;
|
||||
import org.keycloak.testsuite.admin.concurrency.ConcurrentLoginTest;
|
||||
import org.keycloak.testsuite.arquillian.ContainerInfo;
|
||||
import org.keycloak.testsuite.rest.representation.JGroupsStats;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
||||
*/
|
||||
public class ConcurrentLoginClusterTest extends ConcurrentLoginTest {
|
||||
|
||||
|
||||
@ArquillianResource
|
||||
protected ContainerController controller;
|
||||
|
||||
|
||||
// Need to postpone that
|
||||
@Override
|
||||
public void addTestRealms(List<RealmRepresentation> testRealms) {
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
@Override
|
||||
public void beforeTest() {
|
||||
// Start backend nodes
|
||||
log.info("Starting 2 backend nodes now");
|
||||
for (ContainerInfo node : suiteContext.getAuthServerBackendsInfo()) {
|
||||
if (!controller.isStarted(node.getQualifier())) {
|
||||
log.info("Starting backend node: " + node);
|
||||
controller.start(node.getQualifier());
|
||||
Assert.assertTrue(controller.isStarted(node.getQualifier()));
|
||||
}
|
||||
}
|
||||
|
||||
// Import realms
|
||||
log.info("Importing realms");
|
||||
List<RealmRepresentation> testRealms = new LinkedList<>();
|
||||
super.addTestRealms(testRealms);
|
||||
for (RealmRepresentation testRealm : testRealms) {
|
||||
importRealm(testRealm);
|
||||
}
|
||||
log.info("Realms imported");
|
||||
|
||||
// Finally create clients
|
||||
createClients();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void concurrentLoginSingleUser() throws Throwable {
|
||||
super.concurrentLoginSingleUser();
|
||||
JGroupsStats stats = testingClient.testing().cache(InfinispanConnectionProvider.USER_SESSION_CACHE_NAME).getJgroupsStats();
|
||||
log.info("JGroups statistics: " + stats.statsAsString());
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -59,8 +59,8 @@ import static org.hamcrest.Matchers.anyOf;
|
|||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.jgroups.util.Util.assertTrue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
||||
|
@ -374,7 +374,7 @@ public class RegisterTest extends AbstractTestRealmKeycloakTest {
|
|||
Assert.assertNotNull(user);
|
||||
Assert.assertNotNull(user.getCreatedTimestamp());
|
||||
// test that timestamp is current with 10s tollerance
|
||||
Assert.assertTrue((System.currentTimeMillis() - user.getCreatedTimestamp()) < 10000);
|
||||
assertTrue((System.currentTimeMillis() - user.getCreatedTimestamp()) < 10000);
|
||||
assertUserBasicRegisterAttributes(userId, username, email, "firstName", "lastName");
|
||||
}
|
||||
|
||||
|
@ -606,7 +606,7 @@ public class RegisterTest extends AbstractTestRealmKeycloakTest {
|
|||
Assert.assertNotNull(user);
|
||||
Assert.assertNotNull(user.getCreatedTimestamp());
|
||||
// test that timestamp is current with 10s tollerance
|
||||
Assert.assertTrue((System.currentTimeMillis() - user.getCreatedTimestamp()) < 10000);
|
||||
assertTrue((System.currentTimeMillis() - user.getCreatedTimestamp()) < 10000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,13 +13,15 @@
|
|||
mcast_recv_buf_size="25m"
|
||||
ip_ttl="${jgroups.ip_ttl:2}"
|
||||
thread_naming_pattern="pl"
|
||||
enable_diagnostics="false"
|
||||
bundler_type="no-bundler"
|
||||
max_bundle_size="8500"
|
||||
diag.enabled="${jgroups.diag.enabled:false}"
|
||||
bundler_type="transfer-queue"
|
||||
bundler.max_size="${jgroups.bundler.max_size:64000}"
|
||||
|
||||
thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
|
||||
thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
|
||||
thread_pool.keep_alive_time="60000"
|
||||
|
||||
thread_pool.thread_dumps_threshold="${jgroups.thread_dumps_threshold:10000}"
|
||||
/>
|
||||
|
||||
<!-- Adds RELAY2 for cross-site replication. -->
|
||||
|
|
|
@ -13,13 +13,15 @@
|
|||
mcast_recv_buf_size="25m"
|
||||
ip_ttl="${jgroups.ip_ttl:2}"
|
||||
thread_naming_pattern="pl"
|
||||
enable_diagnostics="false"
|
||||
bundler_type="no-bundler"
|
||||
max_bundle_size="8500"
|
||||
diag.enabled="${jgroups.diag.enabled:false}"
|
||||
bundler_type="transfer-queue"
|
||||
bundler.max_size="${jgroups.bundler.max_size:64000}"
|
||||
|
||||
thread_pool.min_threads="${jgroups.thread_pool.min_threads:0}"
|
||||
thread_pool.max_threads="${jgroups.thread_pool.max_threads:200}"
|
||||
thread_pool.keep_alive_time="60000"
|
||||
|
||||
thread_pool.thread_dumps_threshold="${jgroups.thread_dumps_threshold:10000}"
|
||||
/>
|
||||
<!-- Adds RELAY2 for cross-site replication. -->
|
||||
<!-- Names the local site as site-2. -->
|
||||
|
|
Loading…
Reference in a new issue