Reputation: 7357
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"?
Upvotes: 5
Views: 283
Reputation: 10697
As answered in your other question when the nodes gossip they include which other nodes have seen this update.
Notice that gossip randomly chooses which node to gossip to. Although this system implements a weighted random with preference to the nodes which have not seen the update yet, nodes can still gossip to other nodes which have not seen the update. When this happens the seen set is updated on the pair of gossiping nodes.
The nodes are essentially gossiping about the value and then gossiping about who has seen the value. This protocol actually bundles the two concepts together for simplicity.
Upvotes: 2
Reputation: 4509
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.
Upvotes: 3