[英]Infinispan clustered REPL_ASYNC cache: command indefinitely bounced between two nodes
Im running a spring boot application using infinispan 10.1.8 in a 2 node cluster.我在 2 节点集群中使用 infinispan 10.1.8 运行 Spring Boot 应用程序。 The 2 nodes are communicating via jgroups TCP.这两个节点通过 jgroups TCP 进行通信。 I configured several REPL_ASYNC.我配置了几个 REPL_ASYNC。
The problem: One of these caches, at some point is causing the two nodes to exchange the same message over and over, causing high CPU and memory usage.问题:这些缓存之一在某些时候会导致两个节点一遍又一遍地交换相同的消息,从而导致 CPU 和内存使用率过高。 The only way to stop this is to stop one of the two nodes.阻止这种情况的唯一方法是停止两个节点之一。
More details, here is the configuration.更多细节,这里是配置。
org.infinispan.configuration.cache.Configuration replAsyncNoExpirationConfiguration = new ConfigurationBuilder()
.clustering()
.cacheMode(CacheMode.REPL_ASYNC)
.transaction()
.lockingMode(LockingMode.OPTIMISTIC)
.transactionMode(TransactionMode.NON_TRANSACTIONAL)
.statistics().enabled(cacheInfo.isStatsEnabled())
.locking()
.concurrencyLevel(32)
.lockAcquisitionTimeout(15, TimeUnit.SECONDS)
.isolationLevel(IsolationLevel.READ_COMMITTED)
.expiration()
.lifespan(-1) //entries do not expire
.maxIdle(-1) // even when they are idle for some time
.wakeUpInterval(-1) // disable the periodic eviction process
.build();
One of these caches (named formConfig
) is causing me abnormal communication between the two nodes, this is what happens:这些缓存之一(名为formConfig
)导致我两个节点之间的通信异常,这就是发生的情况:
formConfig
cache behaves properly一段时间内,节点 2 通过 SingleRpcCommand 从节点 1 接收缓存条目,没有异常,即使formConfig
缓存行为正常formConfig
cache一段时间后,一个新的缓存条目被发送到formConfig
缓存At this point the same message seems to keep bouncing between the two nodes:此时,相同的消息似乎在两个节点之间不断跳动:
mn-node1.company.acme-develop sending command to all: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850]
节点 1 向mn-node1.company.acme-develop sending command to all: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850]
发送条目mn-node1.company.acme-develop sending command to all: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850]
mn-node2.company.acme-develop received command from mn-node1.company.acme-develop: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850]
节点 2 接收条目mn-node2.company.acme-develop received command from mn-node1.company.acme-develop: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850]
mn-node2.company.acme-develop sending command to all: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850]
节点 2 将条目发送回节点 1 mn-node2.company.acme-develop sending command to all: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850]
mn-node1.company.acme-develop received command from mn-node2.company.acme-develop: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850],
节点 1 接收条目mn-node1.company.acme-develop received command from mn-node2.company.acme-develop: SingleRpcCommand{cacheName='formConfig', command=PutKeyValueCommand{key=SimpleKey [form_config,MECHANICAL,DESIGN,et,7850],
Some other things:其他一些事情:
formConfig
is the only cache that behaves this way. formConfig
是唯一以这种方式运行的缓存。 All the other REPL_ASYNC caches work properly.所有其他 REPL_ASYNC 缓存都正常工作。 I deactivated only formConfig cache and the system is working correctly.我只停用了 formConfig 缓存,系统工作正常。Here's a more complete log file including logs from both nodes.这是一个更完整的日志文件,包括来自两个节点的日志。
Other infos:其他信息:
I'm suspecting我怀疑
The only scenario where this can happen is when the SimpleKey
has different hashCode()
.唯一可能发生这种情况的情况是SimpleKey
具有不同的hashCode()
。
Are there any exceptions in the log?日志中是否有任何异常? Are you able to check if the hashCode()
is the same after serialization & deserialization of the key?在序列化和反序列化密钥后,您是否能够检查hashCode()
是否相同?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.