简体   繁体   English

Infinispan 集群 REPL_ASYNC 缓存:命令在两个节点之间无限期弹跳

[英]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 )导致我两个节点之间的通信异常,这就是发生的情况:

  1. with jmeter I generate traffic load targeting only node 1使用 jmeter 我生成仅针对节点 1 的流量负载
  2. for some time node 2 receives cache entries from node 1 via SingleRpcCommand, no anomalies, even formConfig cache behaves properly一段时间内,节点 2 通过 SingleRpcCommand 从节点 1 接收缓存条目,没有异常,即使formConfig缓存行为正常
  3. after some time a new cache entry is sent to the formConfig cache一段时间后,一个新的缓存条目被发送到formConfig缓存

At this point the same message seems to keep bouncing between the two nodes:此时,相同的消息似乎在两个节点之间不断跳动:

  • node 1 sends entry 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]
  • node 2 receives the entry 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]
  • node 2 sends the entry back to node 1 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]
  • node 1 receives the entry 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],
  • node 1 sends the entry to node 2 and so on and on...节点 1 将条目发送到节点 2,依此类推……

Some other things:其他一些事情:

  • the system is not under load, jmeter is running only few users in parallel系统没有负载,jmeter 并行运行只有少数用户
  • Even stopping jmeter this loop doesn't stop即使停止 jmeter 这个循环也不会停止
  • 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 缓存,系统工作正常。
  • I cannot reproduce the problem with two nodes running on my machine我无法在我的机器上运行两个节点时重现该问题

Here's a more complete log file including logs from both nodes.这是一个更完整的日志文件,包括来自两个节点的日志。

Other infos:其他信息:

  • opendjdk 11 hot spot opendjdk 11 热点
  • spring boot 2.2.7弹簧靴 2.2.7
  • infinispan spring boot starter 2.2.4 infinispan spring boot starter 2.2.4
  • using JbossUserMarshaller使用JbossUserMarshaller

I'm suspecting我怀疑

  • something related to transactional configuration与事务配置相关的东西
  • or something related to serialization/deserialization of the cached object或与缓存对象的序列化/反序列化相关的东西

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM