Hello! As far as I understand, assignPartitions() will be called as many times as needed in order to always have the latest one.
It is assumed to be stateless anyway. Considerations are the following, as per javadoc: * Gets affinity nodes for a partition. In case of replicated cache, all returned * nodes are updated in the same manner. In case of partitioned cache, the returned * list should contain only the primary and back up nodes with primary node being * always first. * <p> * Note that partitioned affinity must obey the following contract: given that node * <code>N</code> is primary for some key <code>K</code>, if any other node(s) leave * grid and no node joins grid, node <code>N</code> will remain primary for key <code>K</code>. Regards, -- Ilya Kasnacheev пн, 29 окт. 2018 г. в 11:41, kotamrajuyashasvi <[email protected] >: > Hi > > I'm working on a custom affinity function. > According to the documentation : > > https://apacheignite.readme.io/docs/affinity-collocation#section-affinity-function > assignPartitions(...) method is called whenever cluster topology changes. > So > redistribution > of partitions happens after this method is called. What would happen when > cluster topology > changes while the partition redistribution is still in progress. Does > Ignite > internally handle this > case or should we handle it in our custom affinity function code. > > Also what are the important scenarios to consider regarding primary and > backup partition redistribution > while writing our own affinity function. > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
