This repository has been archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Implement id space computation #8
Draft
cache-nez
wants to merge
18
commits into
master
Choose a base branch
from
id-impl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit introduces the following changes: * defines a Router (implementing dela's router.Router). It contains no routing information. Its methods GenerateTableFrom(handshake) and New(players, thisAddress) call NewTable(addresses, thisId), which constructs the routing table from the addresses of other participating nodes and the id of the current node. * implements NewTable. This function traverses shuffled addresses and if the prefix of the given address does not appear in the routing table yet, this address becomes the next hope for this prefix. * sketches the routing. In this prototype, RoutingTable.Forward simply chooses the next hop from the routing table (it assumes the next hop is always in the table). OnFailure does nothing.
…sed routing implementation
A node can receive multiple handshakes and we shouldn't recompute the routing table on each handshake. To keep the first computed routing table: * Change all router's methods to have a pointer receiver * Store the routing table in the router when it's first computed * If a routing table is already computed when a node receives a handshake, do not recompute the table
…uting table. When the node, booting the protocol, calls `Router:New` to create a routing table, the node's address is not included in the set of players' addresses, passed to the method. However, the node *is* a player and should be included in the routing. This is enough to make all other players aware of this node, because the same array of addresses, where the booting node is now included, is passed in a handshake to any new node.
the destination address is not equal to this node's address. This is a hack to accommodate for minogrpc's design, where the only way to reach the client side of the orchestrator is routing a message to nil from the server side of the orchestrator.
…length and base to avoid collisions
When routing to a next hop fails, pick an alternative among nodes, routing to which hasn't failed before: either another node with longer common (with destination) prefix than this node's or a node with the same common prefix, but numerically closer to destination. If routing to all suitable nodes failed, return a Void.
…f signaling an error
OnFailure is invoked to signal that a chosen next hop is unreachable. Simply mark it as such without eagerly computing an alternative. When Forward is invoked and the next hop in the routing table is unreachable, compute the alternative.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To be merged after resilient routing