ignite - Apache Ignite 缓存长时间运行的事务
问题描述
有时,并非总是如此,当我的集群拓扑发生变化时,我的应用程序会挂起长达 1 分钟或更长时间。然后我在日志中看到下面的 Ignite 警告。我想这就是我的应用程序在缓存操作中挂起的原因。
是什么导致了长交易?我预计是网络问题还是 GC?
我无法找出我的代码中的哪个缓存操作导致了这个长事务。警告是否帮助我找出它是什么操作?
22:00:30.456 [grid-timeout-worker-#63][101] WARN org.apache.ignite.internal.diagnostic-[warning] Found long running transaction [startTime=21:58:57.176, curTime=22:00:30.456, tx=GridNearTxLocal [mappings=IgniteTxMappingsImpl [], nearLocallyMapped=false, colocatedLocallyMapped=false, needCheckBackup=null, hasRemoteLocks=false, trackTimeout=false, lb=null, thread=<failed to find active thread 1498>, mappings=IgniteTxMappingsImpl [], super=GridDhtTxLocalAdapter [nearOnOriginatingNode=false, nearNodes=[], dhtNodes=[], explicitLock=false, super=IgniteTxLocalAdapter [completedBase=null, sndTransformedVals=false, depEnabled=false, txState=IgniteTxStateImpl [activeCacheIds=[], recovery=null, txMap=[]], super=IgniteTxAdapter [xidVer=GridCacheVersion [topVer=147994093, order=1536523104974, nodeOrder=74], writeVer=null, implicit=false, loc=true, threadId=1498, startTime=1536523137176, nodeId=e8153238-1d5a-4149-8db8-83a9fc820750, startVer=GridCacheVersion [topVer=147994093, order=1536523104974, nodeOrder=74], endVer=null, isolation=REPEATABLE_READ, concurrency=PESSIMISTIC, timeout=0, sysInvalidate=false, sys=false, plc=2, commitVer=null, finalizing=NONE, invalidParts=null, state=ACTIVE, timedOut=false, topVer=AffinityTopologyVersion [topVer=-1, minorTopVer=0], duration=93280ms, onePhaseCommit=false], size=0]]]]
我的缓存是这样创建的:
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="MFDB_JobList" />
<property name="cacheMode" value="PARTITIONED" />
<property name="backups" value="0" />
<property name="atomicityMode" value="TRANSACTIONAL"/>
<property name="writeSynchronizationMode" value="FULL_SYNC"/>
<property name="indexedTypes">
<list>
<value>java.util.UUID</value>
<value>CacheJobQueueEntry</value>
</list>
</property>
</bean>
相关的 ignite 配置如下所示:
<property name="networkTimeout" value="60000" />
<property name="networkSendRetryCount" value="10" />
<property name="failureDetectionTimeout" value="100000" />
<property name="clientFailureDetectionTimeout" value="100000" />
解决方案
通过以下链接:-
https://issues.apache.org/jira/browse/IGNITE-6980
也试试
<property name="atomicityMode" value="ATOMIC"/>
使用异步缓存操作。它可能有助于最小化上述问题。
推荐阅读
- git - Github - 将工件提交到存储库
- r - 替换R中数据框中的值
- powershell - Powershell 脚本 - 返回 SSRS 报告名称、路径和连接字符串
- python - Sympy:是否可以使用 Idx 范围自动评估分段表达式?
- verilog - 对条件语句使用向量位选择
- excel - 从单元格 i 循环到最后一个单元格非空单元格
- java - Gradle:如何使静态资源在同一项目模块的类路径上可用
- python - 如何有效地在python中循环opencv代码
- java - Java中是否有与Promise.race()等价的东西?
- docker - docker如何在同一主机上的默认桥上处理不同容器之间的通信?