You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/01/03 05:49:25 UTC

[GitHub] [incubator-shardingsphere] xiaolongyuan opened a new issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问

xiaolongyuan opened a new issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问
URL: https://github.com/apache/incubator-shardingsphere/issues/3858
 
 
   版本 4.0.0.RC3
   
   service.id | String | leaf_snowflake位于注册中心上的服务标识
   -- | -- | --
   
   如何设置 每个实例都不一样?
   
   现在把这个设置成一样  并发下会出现重复ID问题
   
   如果推荐做法是设置成一样 那么是否 如下 代码 判断存在BUG?
   
   ```
       private Long initializeWorkIdNodeIfNeed(final RegistryCenter leafRegistryCenter) {
           String workIdDirectory = getWorkIdDirectoryWithServiceId();
           if (leafRegistryCenter.isExisted(workIdDirectory)) {
               String workIdInString = leafRegistryCenter.getDirectly(workIdDirectory);
               return Long.parseLong(workIdInString);
           } else {
               Long result = updateCurrentMaxWorkIdInRegisterCenter();
               leafRegistryCenter.persist(workIdDirectory, String.valueOf(result));
               return result;
           }
       }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu closed issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问
URL: https://github.com/apache/incubator-shardingsphere/issues/3858
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] xiaolongyuan commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问

Posted by GitBox <gi...@apache.org>.
xiaolongyuan commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问
URL: https://github.com/apache/incubator-shardingsphere/issues/3858#issuecomment-570471712
 
 
   ![image](https://user-images.githubusercontent.com/3142363/71709180-ab91fa00-2e30-11ea-9102-20d413a1d077.png)
   
   
   ![image](https://user-images.githubusercontent.com/3142363/71709203-c3697e00-2e30-11ea-827a-35c5655349ea.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] xiaolongyuan commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问

Posted by GitBox <gi...@apache.org>.
xiaolongyuan commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问
URL: https://github.com/apache/incubator-shardingsphere/issues/3858#issuecomment-571955654
 
 
   有同样问题的小伙伴们 建议使用 美团的开源算法自定义实现

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问
URL: https://github.com/apache/incubator-shardingsphere/issues/3858#issuecomment-570476878
 
 
   **For English only**, other languages will not accept.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] xiaolongyuan commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问

Posted by GitBox <gi...@apache.org>.
xiaolongyuan commented on issue #3858: 自增ID算法LEAF_SNOWFLAKE的`service.id`使用疑问
URL: https://github.com/apache/incubator-shardingsphere/issues/3858#issuecomment-571955913
 
 
   地址 https://github.com/Meituan-Dianping/Leaf

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services