forked from nats-io/nats-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cluster formation when servers connect quickly
Both seed and chained cases are now handled properly when servers connect quickly and concurrently to one another. When accepting a route, the server will forward the new route INFO protocol to its known routes. In turn those routes will connect to the new server (if not already connected). A retry for implicit route was introduced to mitigate the issue with two servers connecting to each other and electing the opposite connection as the winner, resulting in both connections being dropped. The server with smaller ID will try once to reconnect. Some tests were fixed to handle possible extra INFO protocol. New tests added. Fix issue: nats-io#206
- Loading branch information
Showing
11 changed files
with
793 additions
and
229 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2016 Apcera Inc. All rights reserved. | ||
|
||
# Cluster Seed Node | ||
|
||
port: 7222 | ||
net: '127.0.0.1' | ||
|
||
http_port: 9222 | ||
|
||
cluster { | ||
host: '127.0.0.1' | ||
port: 7248 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2016 Apcera Inc. All rights reserved. | ||
|
||
# Cluster Seed Node | ||
|
||
port: 7222 | ||
net: '127.0.0.1' | ||
|
||
http_port: 9222 | ||
|
||
cluster { | ||
host: '127.0.0.1' | ||
port: 7248 | ||
|
||
tls { | ||
# Route cert | ||
cert_file: "../test/configs/certs/server-cert.pem" | ||
# Private key | ||
key_file: "../test/configs/certs/server-key.pem" | ||
# Specified time for handshake to complete | ||
timeout: 2 | ||
|
||
# Optional certificate authority verifying connected routes | ||
# Required when we have self-signed CA, etc. | ||
ca_file: "../test/configs/certs/ca.pem" | ||
} | ||
} |
Oops, something went wrong.