Description
AlwaysFailoverSpi.failover() method makes several attempts (5 by default) to get new primary node for the affinity key. Affinity assignment takes time, so there is a big chance to make all these attempts before new node is returned.
We need to add discovery event that initiated failover to FailoverContext and wait for affinity is assigned.