How does a node know which nodes have seen the current state of the cluster?

I read the akka documentation and come up with some problems related to how they implemented Gossip . (here). The part that confused me (emphasized mine):

Periodically, the default value is 1 second, each node selects a different random node to start the gossip round. If less than 1/2 the nodes are in the visible set (saw a new state), then cluster gossip 3 times, and not once per second. the gossip interval is a way to accelerate the convergence process in the early phase of propagation after a state change.

So, if the round of gossip is at the beginning (less than ยฝ nodes saw the current state), the nodes from the seen set start sending 3 gossip instead of a second. But if gossip rapprochement occurs, how do they know about it (they still continue to send gossip 3 times per second). Or maybe convergence of gossip across the cluster is the same as any other โ€œcluster eventโ€?

+4
source share
2 answers

As you know, gossip convergence occurs when all nodes are visible (i.e. all member nodes are in the visible Gossip event list). If the cluster does not converge, ClusterDeamon speeds up 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)

. . .

+3

, , .

, , node . , , , . , .

, . .

+2

Source: https://habr.com/ru/post/1654223/


All Articles