Skip to content
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

Update to Raft V2 stage one #2282

Merged
merged 8 commits into from
Feb 8, 2017
Merged

Update to Raft V2 stage one #2282

merged 8 commits into from
Feb 8, 2017

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Feb 3, 2017

This PR updates Nomad to use Raft V2, Stage One.

Copy link
Contributor

@slackpad slackpad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted a few minor things, otherwise LGTM.

s.logger.Printf("[INFO] nomad: Attempting bootstrap with nodes: %v", addrs)
if err := s.raft.SetPeers(addrs).Error(); err != nil {
s.logger.Printf("[ERR] nomad: failed to bootstrap peers: %v", err)
// Attempt a live bootstrap!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a later commit I ended up adding an additional check here. This isn't strictly required, but helps prevent spurious leader elections if another server is added later - hashicorp/consul#2319.

peersTimeout.Reset(peersPollInterval + lib.RandomStagger(peersPollInterval/peersPollJitterFactor))
return nil
}
}
consulQueryCount++

s.logger.Printf("[DEBUG] server.consul: lost contact with Nomad quorum, falling back to Consul for server list")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

nomad/server.go Outdated
after an outage. It should be formatted as a JSON array containing the address
and port of each Consul server in the cluster, like this:

["10.1.0.1:8500","10.1.0.2:8500","10.1.0.3:8500"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were wrong in the initial PR for Consul, and don't look right for Nomad. Should update these port numbers.

nomad/server.go Outdated

Under normal operation, the peers.json file will not be present.

When Consul starts for the first time, it will create this peers.info file and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Consul/Nomad/

@dadgar dadgar merged commit 15b2697 into master Feb 8, 2017
@dadgar dadgar deleted the f-raft-v2-stage-one branch February 8, 2017 23:26
@github-actions
Copy link

github-actions bot commented Apr 6, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants