Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Docs Required
Description
We keep history of GridAffinityAssignmentCache#MAX_HIST_SIZE affinity assignments. However, flood of client joins/leaves may wipe it out entirely and cause fail/hang of transaction that was started before the flood due to the following exception:
if (cache == null || cache.topologyVersion().compareTo(topVer) > 0) { throw new IllegalStateException("Getting affinity for topology version earlier than affinity is " + "calculated [locNode=" + ctx.discovery().localNode() + ", grp=" + cacheOrGrpName + ", topVer=" + topVer + ", head=" + head.get().topologyVersion() + ", history=" + affCache.keySet() + ']'); }
History is limited in order to prevent JVM heap overflow. At the same time, only "server event" affinity assignments are heavy: "client event" assignments are just shallow copies of "server event" assignments.
I suggest to limit history by the number of "server event" assignments.
Also, considering the provided fix, I don't see any need to keep 500 items in history. I propose to change history size to 50.
Attachments
Issue Links
- is duplicated by
-
IGNITE-10249 TcpDiscoveryMultiThreadedTest#testCustomEventNodeRestart: Getting affinity for topology version earlier than affinity is calculated
- Resolved
-
IGNITE-10389 Getting affinity for topology version earlier than affinity is calculated
- Resolved
-
IGNITE-12014 Getting affinity for topology version earlier than affinity is calculated for system cache
- Resolved
- relates to
-
IGNITE-8098 Getting affinity for topology version earlier than affinity is calculated because of data race
- Open
- links to