Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Avoid collision in random member names #1881

Closed
hongchaodeng opened this issue Jan 24, 2018 · 1 comment · Fixed by #1882
Closed

Avoid collision in random member names #1881

hongchaodeng opened this issue Jan 24, 2018 · 1 comment · Fixed by #1882

Comments

@hongchaodeng
Copy link
Member

hongchaodeng commented Jan 24, 2018

We randomized etcd member names in #1872. However, the key space is very small 27^5 = 14.3M. We should consider collision case.

Potential solutions:

  1. Use UUID. We have one: https://github.com/pborman/uuid . Or update it with new one: https://github.com/satori/go.uuid .
  2. We probably just have 2 or 3 members. Just check name conflict before creating one. Note that we couldn't avoid "previous cluster" case in this way.
  3. Or just extend length to 10, key space becomes 27^10=2e14
@hongchaodeng hongchaodeng changed the title Avoid conflict in random member names Avoid collision in random member names Jan 24, 2018
@hongchaodeng
Copy link
Member Author

We will go with option (3).
This requires little changes. From my experience, it is very unlikely to conflict under 2e14 key space.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant