Added sync message. Refactored connect flow. Adverts are gossipped.
This commit adds a Sync message which is sent as a reply to Connect message. This should in theory speed up convergence of a (re)connecting node. We respond to Sync message by sending a peer message back to the peer origin of the Sync message. We consequently update our routing table and peer graph with the data sent in via Sync message. We now gossip advertse to up to 3 randomly selected peers instead of sending a multicast message to the network. Equally, Solicitation i.e. full table adverts are gossipped to a randomly selected peer. If that fails we send a multicast message to the network.
This commit is contained in:
@@ -103,10 +103,8 @@ message Peer {
|
||||
|
||||
// Sync is network sync message
|
||||
message Sync {
|
||||
// node address
|
||||
string address = 1;
|
||||
// node peers
|
||||
repeated Peer peers = 2;
|
||||
// peer origin
|
||||
Peer peer = 1;
|
||||
// node routes
|
||||
repeated go.micro.router.Route routes = 3;
|
||||
repeated go.micro.router.Route routes = 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user