I'm trying to load local partitions of a partitioned cache when a minimum number of nodes (let's say 2) join a cluster. To do that I'm deploying a listener for NODE_JOIN discovery event. Once the 2nd node joins, the listener fires on the 1st node and triggers execution of cache load logic in a separate thread which calls Affinity.primaryPartitions(<local-node>) to determine specific local partitions to load. The problem is that this call returns all partitions which means partition-2-node assignment has not been updated yet on this 1st node. However, correct partition set will be returned if I force a thread to sleep for some time before checking the partition-2-node assignment. The same partition determination logic is executed on the 2nd node as well. In this case the call to Affinity.primaryPartitions(<local-node>) always correctly returns every other partition. The question is how to avoid the race condition on the 1st node?
-- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Race-condition-with-partition-affinity-mapping-tp7848.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
