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

snowflake sequencer assumes hashing host:port to 1024 integers never collides #2213

Closed
tv42 opened this issue Jul 23, 2021 · 1 comment
Closed

Comments

@tv42
Copy link

tv42 commented Jul 23, 2021

Reading v2.59 source, the snowflake sequencer assigns host id by hash(host:port) % 0x3ff.
1024 choices isn't all that many.
If I'm using my calculator correctly, a 3-master cluster will hit it 0.3% and 5-master 1% of the time.

Maybe [master.sequencer] type="snowflake" needs to take an ID, and refuse to work without a user-assigned one?
(Or, if the nodes are supposed to share the config file, a mapping from host:port to ID?)

@chrislusf
Copy link
Collaborator

Thanks for your analysis and suggestion!

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

No branches or pull requests

2 participants