-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Duplicate names in ETCD_INITIAL_CLUSTER
not handled correctly
#13757
Comments
A member can have multiple client or peer URLs. So in this case, you must specify the flag |
@ahrtr Would it be okay if I work on this? |
@Divya063 Definitely yes. Thank you! |
Hey @mortehu After that I ran this command:
After adding the member, I exported the required variables and executed etcd listen command: Instead, the error was:
Can you please tell me where I went wrong in reproducing the error? I followed the same given commands for terminal x and y. |
hey, I'm looking for a beginner-friendly issue if this one is available |
Thanks @keremgocen , let's double confirm with @Divya063 firstly to avoid doing duplicate work. @Divya063 are you still working on this? |
@keremgocen Do let me know if you are bale to replicate the issue? I am also looking to work on some beginner-friendly issues. @ahrtr |
Two comments:
|
Thanks a lot for your reply. I'll check it. |
Looks like no progress on this issue. I would like to work on it. |
I read the relevant code and found that At other times, it is just an identifier without any constraints. Even the same member can be started with a different name each time So I am more inclined to accept duplicate names in ETCD_INITIAL_CLUSTER and treat them as separate members. What's your opinion? Thanks! @serathius @ahrtr |
Just as I mentioned previously #13757 (comment), each member can have multiple peer URLs. In the following example,
I think we just need to print a warning message if users do not provide a value for |
Thanks for the explanation! I missed that comment... |
hi @UtR491 sure, I reproduced and fixed it locally, just not finished testing, and I wanted to wait for a reply because I'm not that familiar with etcd. A PR will be submitted this week. If you could fix it and add test cases quickly, PR is welcome, I wouldn't mind. |
What happened?
If you don't pass a
--name
argument to youretcd
processes, they will all have the namedefault
and the cluster will operate normally. However, when you add a member, the generatedETCD_INITIAL_CLUSTER
variable will have multiple entries with the name "default". When this environment variable is used,etcd
will parse these into a mapping under a single key ("default") with multiple URLs, and create a single member. Seeetcd/server/etcdserver/api/membership/cluster.go
Lines 83 to 86 in 63a1cc3
This leads to the confusing error message "member count is unequal". The documentation on https://etcd.io/docs/v3.5/op-guide/runtime-configuration/ mentions this failure, but the situation is different.
What did you expect to happen?
Either
a.
member add
should fail, saying it cannot generate a validETCD_INITIAL_CLUSTER
due to duplicate names, orb.
etcd
should accept duplicate names inETCD_INITIAL_CLUSTER
and treat them as separate members. This can be accomplished by updatingfunc NewClusterFromURLsMap
as follows:I don't know if there's a real need to be able to specify multiple URLs for a single member.
How can we reproduce it (as minimally and precisely as possible)?
You need three terminals,
x
,y
, andz
:Anything else we need to know?
No response
Etcd version (please run commands below)
Etcd configuration (command line flags or environment variables)
paste your configuration here
Etcd debug information (please run commands blow, feel free to obfuscate the IP address or FQDN in the output)
etcd 3.5.2
Relevant log output
No response
The text was updated successfully, but these errors were encountered: