0

I was reading about gossip style failure detection.

In the notes that I was reading it's stated that: a single heartbeat takes O(log(N)) time to propagate but this statement is not explained

Any idea why this is?

bsky
  • 19,326
  • 49
  • 155
  • 270

2 Answers2

2

Because the most effective way of propagation in such case is using the Binary Tree structure (or any k-ary tree). First node sends message to its children, they send message to their children etc. Binary tree has height of log n, every level in the tree represents one stage of propagating messages, so the overall time equals O(log n).

Tony Babarino
  • 3,355
  • 4
  • 32
  • 44
1

You start by sending message to k nodes. Each of them sends a message to k nodes and collects back their responses. Each hop multiplies the number of nodes that have received the message by k. All the nodes have received the message when k^t >= N. The clock time it takes for this to happen is proportional to t, the number of hops.

k^t = N => log_k(N)=t

We know that the clock time is proportional to t, so it must be proportional to log_k(N).

I'm not familiar with gossip in particular but this answer applies to most broadcast messages on most cluster fabrics.

masonk
  • 9,176
  • 2
  • 47
  • 58