...
Cluster topology is an ordered set of client and server nodes at a certain point in time. Each stable topology topologhe first node in the list corresponds to the primary node, and other nodes arey is assigned a topology version number - monotonically increasing pair of counters (majorVer, minorVer). Major version is used for tracking grid node events such join, left or fail, minor version is used for tracking internal events such cache start or activation. Each node maintains a list of nodes in the topology, and it is the same on all nodes for a given version. Topology changes are received by nodes It is important to note that each node receives information about topology changes at different times, meaning that at any point in time, nodes can see different topology versions, but eventually they will all see the same.
Affinity function
...
Every change in the topology - adding or removing nodes - causes creates a new topology version. For each new version of the topology, it is necessary to calculate the distribution of data between the nodes. Nodes that are responsible for storing data are called affinity nodes. Each node owns a subset of partitions. If a new affinity node joins the cluster, the data is rebalanced to accommodate the new node.
...
The first node in the list corresponds to the primary node, and other nodes are backups. Only list prefix equal in size to owners count is used, other nodes are ignored. Only those nodes from that belong to the prefix list prefix with a the length of backups + 1 are used for data placement, others are ignored for partitioned cache.
...