Introduce plumtree broadcast method in corrosion.#492
Conversation
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
796e90a to
232917e
Compare
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
gorbak25
left a comment
There was a problem hiding this comment.
Amazing work! Mostly nits. The main thing i'm worrying about is that there are no tests for rebalancing the tree when a peer gets down/shuts down ungracefully. I don't see other peers getting notified that we're down on graceful shutdown.
|
|
||
| Lower values optimize the tree more aggressively (more `GRAFT`/`PRUNE` churn); higher values leave the tree alone unless the improvement is large. Defaults to `7`. | ||
|
|
||
| ##### `batch_gossip` |
There was a problem hiding this comment.
Does it seem that we will use that option?
There was a problem hiding this comment.
Yes, Batching gossips didn't help smaller regional clusters. But I think it would be useful on global clusters that is pushing a lot of changes.
| let (near_pool, mid_pool, far_pool) = self.bucket_pools(); | ||
|
|
||
| // we mostly want eager peers to be low rtt, but throw in a mix of mid and far peers; | ||
| // percentage is roughly 50% near, 30% mid, 20% far. targets are computed over the |
There was a problem hiding this comment.
Can we make that ratio configurable and exposed in the config?
There was a problem hiding this comment.
That sounds good
| @@ -0,0 +1,2209 @@ | |||
| use indexmap::{IndexMap, IndexSet}; | |||
There was a problem hiding this comment.
Amazing work! The main thing which is missing is to send PRUNE's to eager peers during graceful node shutdown. Imagine we run systemctl stop corrosion2 on an node which has a lot of links. Without graceful handling we would need to first wait for foca to decect the peer is down, then plumtree will remove that peer and only after a few missed rounds the tree will get rebalanced. What is the round interval?
There was a problem hiding this comment.
fair, Mostly left membership notifications to foca.
Because tree is not symmetric - we could have eager peers that don't have us an eager peer. So prune only saves them from sending us a message. We could maintain a separate set with this info though, although foca is quick enough that I don't think that it is worth it.
plumtree will remove that peer and only after a few missed rounds the tree will get rebalanced.
Any missed messages would cause grafts before foca even sends the notifications.
| } | ||
|
|
||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||
| pub struct PlumtreeConfig { |
There was a problem hiding this comment.
Do you mean number of rounds when we keep broadcasting a message?
| #[derive(Debug, Clone, Default, Serialize, Deserialize)] | ||
| pub struct PlumtreeStats { | ||
| /// Peers we push GOSSIP to directly (the spanning-tree branches). | ||
| pub eager_peers: Vec<ActorId>, |
There was a problem hiding this comment.
OFFTOP: I'm tempted to vibe code a visualization of this :D Imagine we would query those edges every few seconds and we could lookup how the tree looks like
There was a problem hiding this comment.
Ha, that's a very good idea. We could easily see the tree and how it is changing.
| counter!("corro.plumtree.send.dropped").increment(1); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
prune eager links to other peers or notify them that we're down?
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This pull requests adds a new plumtree protocol for broadcasting changes across a cluster. It is modelled after the original plumtree protocol outlined in the original paper but it differs in a number of key ways.
The plumtree method can be enabled by adding this to the node config
This was partly inspired by: https://github.com/johnnywale/memberlist-plumtree