Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

lower topology periodic gossip complexity #521

Merged

Conversation

rade
Copy link
Member

@rade rade commented Apr 7, 2015

Instead of gossiping to all neighbours, we select up to log(n_peers) neighbours at random, based on a probability distribution that takes into account the topology, i.e. favours neighbours at the end of "bottleneck" links. The distribution is determined from the unicast topology.

Closes #517.

@rade
Copy link
Member Author

rade commented Apr 7, 2015

@bboreham review please.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.58%) to 38.04% when pulling 22f4bde on rade:517_lower_topology_periodic_gossip_complexity into 86abc6a on zettio:master.

@bboreham
Copy link
Contributor

bboreham commented Apr 8, 2015

(discussed offline) selecting min(n_connections, log(n_peers)) connections to send down (as opposed to log(n_peers) peers, which may lie down fewer connections) seems a worthwhile improvement - more resilient to awkward topologies, while retaining the benefit that the overall cost is O(nlogn)

@rade rade self-assigned this Apr 8, 2015
rade added 2 commits April 9, 2015 11:44
This was a convenient but rather suspect coupling. In particular, it
will break if the period gossip logic changes s.t. it no longer sends
gossip on all connections every interval.
@rade rade force-pushed the 517_lower_topology_periodic_gossip_complexity branch from 22f4bde to 98fce9d Compare April 9, 2015 10:45
@rade rade force-pushed the 517_lower_topology_periodic_gossip_complexity branch from 98fce9d to 12c97b4 Compare April 9, 2015 17:11
@rade rade assigned bboreham and unassigned rade Apr 9, 2015
@rade
Copy link
Member Author

rade commented Apr 9, 2015

I've changed the neighbour selection to use the min(n_neighbours, log(n_peers)), excluded the gossip sender, and added some documentation.

@@ -167,7 +167,7 @@ func (c *GossipChannel) deliverBroadcast(srcName PeerName, _ []byte, dec *gob.De
return c.relayBroadcast(srcName, data)
}

func (c *GossipChannel) deliver(_ PeerName, _ []byte, dec *gob.Decoder) error {
func (c *GossipChannel) deliver(srcName PeerName, _ []byte, dec *gob.Decoder) error {

This comment was marked as abuse.

bboreham added a commit that referenced this pull request Apr 10, 2015
@bboreham bboreham merged commit 2ba8f34 into weaveworks:master Apr 10, 2015
@rade rade modified the milestone: 0.10.0 Apr 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

periodic topology gossip is O(n^2)
3 participants