goaymode created IGNITE-25727:
---------------------------------
Summary: Lock Contention and OOM Risks in
GridDhtPartitionTopologyImpl and RingMessageWorker
Key: IGNITE-25727
URL: https://issues.apache.org/jira/browse/IGNITE-25727
Project: Ignite
Issue Type: Improvement
Components: cache, messaging
Affects Versions: 2.16
Reporter: goaymode
There is a potential for performance degradation and OOM issues in
[GridDhtPartitionTopologyImpl.nodes0.|https://github.com/apache/ignite/blob/fb76e9cdd324a8f43009451a5bc81b0806047d53/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java#L1203]
Every topology change invalidates cached mappings and forces full iterations
over node2part, making the cost scale with the number of retained nodes. Also
since nodes0 is called once per partition, the total cost grows linearly with
the number of partitions. Each call also creates a new
[ArrayList|https://github.com/apache/ignite/blob/fb76e9cdd324a8f43009451a5bc81b0806047d53/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java#L1243]
of nodes increasing memory pressure if there are many large concurrent
allocations. All of these run under a read lock, increasing the chance of
contention and delays during high load or frequent topology changes.
[ServerImpl$RingMessageWorker.checkFailedNodesList|https://github.com/apache/ignite/blob/fb76e9cdd324a8f43009451a5bc81b0806047d53/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java#L6251]
also has a similar performance risk under high load or frequent invocation. A
synchronized block is being used used in combination with iteration over the
failedNodes and failedNodesMsgSent collections. As these collections grow
especially when many nodes fail—each invocation becomes more expensive and
increases the risk of contention and synchronization bottlenecks.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)