hashicorp / hashicorp/consul

Automatically skip self-join

Open
#2,868 22 comments 4 reactions 1 assignee Claimed by @aaronraff View on GitHub
Hacktoberfest help-wanted theme/operator-usability type/docs type/enhancement
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

It is unclear to me from the docs of `start_join`/`retry_join` whether this value should contain all consul servers that I want in the cluster, or only the other ones (not the current machine).

Looking at a 3-node cluster boostrapping from a automatic deployment, it seems to me that it has to be the latter, because otherwise if `retry_join = [machine1, machine2, machine3]`:

* machine1 boots up first, sees only itself, joins itself
* machine2 and 3 boot at the same time a bit later, try to join each other first, which succeeds

Because the behaviour of `retry_join` is _"Takes a list of addresses to attempt joining every retry_interval until *at least one* join works"_ instead of _"until all joins work"_, each none of the machines try to join any other machines.

So due to this race we end up in a situation where we have 2 split clusters `{machine1}` and `{machine2,machine3}`, as opposed to the desired `{machine1,machine2,machine3}`. And it stays that way.

And then we get lots of `agent: failed to sync remote state: No cluster leader`.

Is this analysis correct?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.