I'm reading akka documentation and come up with some troubles of undertanding the way they implemented Gossip. (docs here). The part that confused me, (emphasized mine):
Periodically, the default is every 1 second, each node chooses another random node to initiate a round of gossip with. If less than ½ of the nodes resides in the seen set (have seen the new state) then the cluster gossips 3 times instead of once every second. This adjusted gossip interval is a way to speed up the convergence process in the early dissemination phase after a state change.
So, if the gossip round is in the beginning (less then ½ nodes have seen the current state), the nodes from seen set start sending 3 gossips a second instead of one. But if the gossip convergence happened how do they know about that (they still keep sending gossip 3 times a second). Or maybe convergence is gossiped throughout the cluster just as any other "cluster event"?
As you may know gossip convergence happens when all nodes are seen (i.e all member nodes are in the seen list of Gossip event). If cluster is not converged ClusterDeamon speeds up the gossip.
def gossipTick(): Unit = {
gossip()
if (isGossipSpeedupNeeded) {
scheduler.scheduleOnce(GossipInterval / 3, self, GossipSpeedupTick)
scheduler.scheduleOnce(GossipInterval * 2 / 3, self, GossipSpeedupTick)
}
}
def isGossipSpeedupNeeded: Boolean =
(latestGossip.overview.seen.size < latestGossip.members.size / 2)
Once cluster has been converged, it falls back to normal scheduled gossip ticks using configured gossip interval. Have a look at source and test specs of this feature. Hope this helps.