-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
The instanceId(use snowflake generator ) is different when register same instance twice #4467
Comments
If same instance register twice, should different instanceId. If update instance, the instanceId should be same. |
We can't differ update or twice register. we modify the instance matadata in console, it's update. But in controller, it's will register again. |
So I think just judge whether old instance exist, if exist, use old instanceId, instanceId should not be update except deregister then register. Or we need to discuss whether push down instance generating to client part. I think id generate in server part is not reasonable. |
If generating in client side, we can't gan guarantee that the instanceId will repeat, so also need judge in server side. |
Users to guarantee. the instance definition is controlled by users. We only received and apply it. The snowflake need add an workId, which need user input. It can make sure instance not duplicate. |
what's the concept of workId? |
this is a concept from snowflake. |
good idea, but it will increase the cost of use for user, user need consider the way how to differ workId. It's unfriendly for user. |
Even add it in server part, user also need to learn workid and snowflake, otherwise they can't use well because BTW, the instanceId means the Also we can generate the workId in client part, such as use |
But now we has implemented in server part, so we need to adapt it first in a few time. |
hash conflict need be consider, it also cann't guarantee the unique workId. |
workId may not suit our situation, the workId is certain such as |
I just give an example, when we execute this plan, we need to discuss more details. |
Describe the bug
Now the user register instance with metadata {"preserved.instance.id.generator", "snowflake"}. It will generate instanceId with auto increment number.
If we register the instance again or update is't metadata in console, it's id will change 0 -> 1 and 1 -> 0 again and again.
Expected behavior
If the origin id is snowflake id, just remains it.
The text was updated successfully, but these errors were encountered: