8000 don't stall gossip broadcasting when there are blocked connections by rade · Pull Request #1831 · weaveworks/weave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

don't stall gossip broadcasting when there are blocked connections #1831

Closed
wants to merge 52 commits into from

Conversation

rade
Copy link
Member
@rade rade commented Dec 24, 2015

See commits for explanation.

Note that this PR is based on #1826.

@rade rade force-pushed the gossip-broadcast-stall-3 branch from 71e8edc to 1306946 Compare December 24, 2015 17:35
@rade rade mentioned this pull request Dec 24, 2015
@rade rade force-pushed the cleaner-gossip-sender branch from dc1ebb0 to 9702faf Compare December 24, 2015 22:13
@rade rade force-pushed the gossip-broadcast-stall-3 branch from 1306946 to 5651a17 Compare December 24, 2015 22:14
@rade rade force-pushed the cleaner-gossip-sender branch from 9702faf to e952021 Compare December 30, 2015 12:10
@rade rade force-pushed the gossip-broadcast-stall-3 branch 2 times, most recently from fa74e07 to 4341ec2 Compare December 30, 2015 12:33
rade added 23 commits December 30, 2015 14:07
- level 2 headings for top-level instead of level 3
- put all status reporting as L3s under one L2 heading
- add 'Reboots' to ToC
- move 'Stopping weave' into its own section and and move that
and eliminate duplication

Fixes #1842.
And also make the error message more meaningful.

Fixes #1843.
instead just don't auto-detect TLS args in that case.

This makes `weave --local launch` work (again).

Fixes #1844.
rade and others added 26 commits December 31, 2015 12:32
...rather than via an env var. This is cleaner.
PROCFS is always set
changed my mind

This reverts commit 20a8488.
I broke this in 3702126.

Fixes #1848.
Previously broadcasts were being handled by one GossipSender per
broadcast source (and channel), which sends the broadcast to all next
hops, and hence can stall when a single destination is stalled.

Here we get rid of these per broadcast source GossipSenders. Instead
broadcasts are sent to per-connection GossipSenders for all next hops.

For this we use the existing GossipSenders we have set up for ordinary
gossip. In order to deal with broadcasts they need one GossipData cell
per broadcast source, since only broadcasts from the same source can
be Merge()ed. So we add a PeerName->GossipData map of cells, in
addition to the existing cell for ordinary gossip.

The GossipSender goroutine picks one of the cells at a time, Encode()s
the contents and sends it. It prefers the ordinary gossip cell over
the broadcast cells since typically ordinary gossip is more important.

To reduce coupling, the GossipSenders don't actually know how to
construct protocol messages. They just invoke a couple of functions
for that - one for ordinary gossip and one for broadcast - which are
supplied by the GossipChannel.

There are two downsides to this change:

1. broadcasts get encoded per connection, rather than just once

2. we can potentially end up with O(n_peers^2) cells, each containing
accumulated (via GossipData.Merge()) broadcasts. For this to happen,
the peer must

- deal with gossip from most nodes. This doesn't happen in
  (near)complete connection topologies. Hypercube topologies are
  probably the worst case uniform topology. And a star topology is the
  worst case for a single (the centre) peer.

- have backlogged connections to most of its neighbours, without
  those connections being completely stalled (since that would cause
  heartbeat timeouts to terminate them).

Furthermore, for this to matter in practise, the accumulated broadcast
GossipData must be sizeable:

- For topology gossip, GossipData is just a set of PeerNames. Which
  takes very little space and is bounded, since there is a finite
  number of peers. And, if we could get rid of workaround for #1793
  (cbaa92d), then topology broadcasts would only ever contain
  information about the source peer, so the GossipData would contain
  just one PeerName.

- IPAM only employs broadcast during initialisation and shutdown.

- DNS broadcasts contain DNS entries for containers on the source
  peer. Each entry will typically be 100-200 bytes. The accumulated
  broadcast GossipData from a peer will contain entries for all the
  peer's DNS entries, worst case. This includes tombstones,
  i.e. entries for containers that have died. If there is churn,
  i.e. DNS entries being added and removed continuously, and the churn
  rate exceeds the rate at which we can forward those entries, then
  the accumulated broadcast GossipData can grow unbounded. Note that
  this is the case on master too; the difference here is that we can
  have up to n_peers copies of that GossipData.
@rade rade force-pushed the gossip-broadcast-stall-3 branch from 4341ec2 to 8d30953 Compare January 5, 2016 17:13
@rade
Copy link
Member Author
rade commented Jan 5, 2016

replaced by #1855

@rade rade closed this Jan 5, 2016
@awh awh added this to the n/a milestone Jan 12, 2016
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.

4 participants
0