-
Notifications
You must be signed in to change notification settings - Fork 2k
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
nomad: ensure a unique ClusterID exists when leader (gh-6702) #6707
Conversation
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.
there is a helper func to generate test uuids here if you want https://github.com/hashicorp/nomad/blob/master/helper/uuid/uuid.go#L9
f5477c9
to
bd18682
Compare
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.
No blockers.
We should also expose this somewhere. We've had at least one prod incident where somewhere accidentally joined two distinct clusters that had the same region name. Even if we don't immediately prevent that issue with this ID, it could still make debugging easier.
Mind filing an issue if you think that makes sense?
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.
LGTM
I agree exposing this somewhere might help some engineer someday debug a cluster.
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.
overall looks good - but would love to handle the case of mixed cluster better. thanks!
1ce3712
to
8a1f715
Compare
1832ea2
to
f424ddc
Compare
e67e13a
to
533354c
Compare
Hey all, thanks for looking so closely at this! I've made a bunch of changes, hopefully addressing everything pointed out before. In particular we should be resilient against leadership changes during upgrades now. The intended invariant is that any |
Enable any Server to lookup the unique ClusterID. If one has not been generated, and this node is the leader, generate a UUID and attempt to apply it through raft. The value is not yet used anywhere in this changeset, but is a prerequisite for gh-6701.
f424ddc
to
4e0dd92
Compare
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. |
As leader, check to see if a ClusterID has already been generated
and replicated through the raft log. If one has not been generated,
generate a UUID and push it through. If a ClusterID has been generated,
its value is applied into the state store. The value is not actually
used anywhere in this changeset, but is a prerequisite for gh-6701.
Similar prior art in consul.