-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit cluster to 3 nodes #2905
Limit cluster to 3 nodes #2905
Conversation
@@ -129,6 +129,12 @@ func (s *Store) IDPath() string { return filepath.Join(s.path, "id") } | |||
|
|||
// Open opens and initializes the raft store. | |||
func (s *Store) Open() error { | |||
// Verify that no more than 3 peers. | |||
// https://github.com/influxdb/influxdb/issues/2750 | |||
if len(s.peers) > 3 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is s.peers
increased? When does it hit 4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is that for this to work, peers
must include the guy who is joining, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peers are hardcoded in the configuration file. All nodes need to have the same set of peers so there's not really a sense of "joining" anymore. If you start the first server up and you list 4 peers then it'll immediately fail.
Does this actually stop it from joining or does it just error the server out if they've joined more than 3 to the raft cluster? |
33aab71
to
0c0859f
Compare
@pauldix You have to specify all peers in the config file so it will fail immediately even when the first node tries to start up. |
This commit restricts the maximum number of nodes in a cluster to 3. Fixes influxdata#2750
@benbjohnson ugh, that's really ugly. I guess this means a bunch of work needs to be done in 0.9.1 to add joining a cluster back in as a concept? The config file thing won't work in the real world. Otherwise how are new nodes going to join a cluster? |
0c0859f
to
405ec78
Compare
@pauldix I don't think it'll be a bunch of work. We still need the initial peer set so that nodes can wait for a quorum before creating the initial cluster. |
@benbjohnson cool, I just want to make sure that when we add that in, people running an 0.9.0 cluster will be able to upgrade without breaking config files or anything like that. |
Overview
This pull request restricts the maximum number of nodes in a cluster to 3.
Fixes #2750