Skip to content

Commit

Permalink
[IMPROVED] Routing: reduce chances of duplicate implicit routes
Browse files Browse the repository at this point in the history
This is an alternate approach to the PR #5484 from @wjordan.

Using the code in that PR with the test added in this PR, I could
still see duplicate routes (up to 125 in one of the matrix), and
still had a data race (that could have easily be fixed). The main
issue is that the increment happens in connectToRoute, which is
running from a go routine, so there were still chances for duplicates.

Instead, I took the approach that those duplicates were the result
of way too many gossip protocols. Suppose that you have servers A
and B already connected. C connects to A. A gossips to B that it
should connect to C. When that happened, B would gossip to A the
server C and C would gossip to A the server B, which all that was
unnecessary. It would grow quite fast with the size of the cluster
(that is, several thousands for a cluster size of 15 or so).

Resolves #5483

Signed-off-by: Ivan Kozlovic <[email protected]>
  • Loading branch information
kozlovic committed Jun 27, 2024
1 parent e478fae commit 0bc2d18
Show file tree
Hide file tree
Showing 3 changed files with 300 additions and 85 deletions.
Loading

0 comments on commit 0bc2d18

Please sign in to comment.