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 2021/06/09 07:30:43 UTC

[GitHub] [shardingsphere] ddx10000 opened a new issue #10732: SNOWFLAKE algorithm causes data skew.

ddx10000 opened a new issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.0.0-RC1-SNAPSHOT
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   The order_id and order_item_id should include odd and even numbers respectively. But all order_id is even number and all order_item_id is odd number.
   ### Actual behavior
   ---------------------------- Print Order Data -----------------------
   order_id: 609400984137347072, user_id: 1, address_id: 1, status: INSERT_TEST_JPA
   order_id: 609400984552583168, user_id: 2, address_id: 2, status: INSERT_TEST_JPA
   order_id: 609400984581943296, user_id: 3, address_id: 3, status: INSERT_TEST_JPA
   order_id: 609400984607109120, user_id: 4, address_id: 4, status: INSERT_TEST_JPA
   order_id: 609400984628080640, user_id: 5, address_id: 5, status: INSERT_TEST_JPA
   order_id: 609400984644857856, user_id: 6, address_id: 6, status: INSERT_TEST_JPA
   order_id: 609400984661635072, user_id: 7, address_id: 7, status: INSERT_TEST_JPA
   order_id: 609400984682606592, user_id: 8, address_id: 8, status: INSERT_TEST_JPA
   order_id: 609400984703578112, user_id: 9, address_id: 9, status: INSERT_TEST_JPA
   order_id: 609400984724549632, user_id: 10, address_id: 10, status: INSERT_TEST_JPA
   ---------------------------- Print OrderItem Data -------------------
   order_item_id:609400984498057217, order_id: 609400984137347072, user_id: 1, status: INSERT_TEST_JPA
   order_item_id:609400984569360385, order_id: 609400984552583168, user_id: 2, status: INSERT_TEST_JPA
   order_item_id:609400984594526209, order_id: 609400984581943296, user_id: 3, status: INSERT_TEST_JPA
   order_item_id:609400984615497729, order_id: 609400984607109120, user_id: 4, status: INSERT_TEST_JPA
   order_item_id:609400984636469249, order_id: 609400984628080640, user_id: 5, status: INSERT_TEST_JPA
   order_item_id:609400984653246465, order_id: 609400984644857856, user_id: 6, status: INSERT_TEST_JPA
   order_item_id:609400984674217985, order_id: 609400984661635072, user_id: 7, status: INSERT_TEST_JPA
   order_item_id:609400984690995201, order_id: 609400984682606592, user_id: 8, status: INSERT_TEST_JPA
   order_item_id:609400984711966721, order_id: 609400984703578112, user_id: 9, status: INSERT_TEST_JPA
   order_item_id:609400984732938241, order_id: 609400984724549632, user_id: 10, status: INSERT_TEST_JPA
   ### Reason analyze (If you can)
   SNOWFLAKE algorithm causes data skew.
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   run org.apache.shardingsphere.example.sharding.spring.boot.jpa.ExampleMain#main
   ### Example codes for reproduce this issue (such as a github link).
   application.properties:
   spring.profiles.active=sharding-tables


-- 
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



[GitHub] [shardingsphere] ddx10000 commented on issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
ddx10000 commented on issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732#issuecomment-858221328


   > The problem is fixed by 3.1.0.
   > 
   > The version `5.0.0-RC1-SNAPSHOT` you reported is not existed, please double check.
   > 
   > FYI: https://shardingsphere.apache.org/document/current/en/faq/#12-why-are-the-default-distributed-auto-augment-key-strategy-provided-by-shardingsphere-not-continuous-and-most-of-them-end-with-even-numbers
   
   


-- 
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



[GitHub] [shardingsphere] RaigorJiang commented on issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732#issuecomment-924771356


   Hi @ddx10000 
   The ID skew you see is not caused by the algorithm, but caused by the specific calling sequence.
   We can adjust the code logic of the example later to make the primary key look more natural.
   Thank you for your feedback.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ddx10000 commented on issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
ddx10000 commented on issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732#issuecomment-860619324


   I had check FAQ, https://shardingsphere.apache.org/document/current/en/faq/#12-why-are-the-default-distributed-auto-augment-key-strategy-provided-by-shardingsphere-not-continuous-and-most-of-them-end-with-even-numbers, but it isn't the same issue.


-- 
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



[GitHub] [shardingsphere] terrymanu commented on issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732#issuecomment-857662885


   The problem is fixed by 3.1.0.
   
   The version `5.0.0-RC1-SNAPSHOT` you reported is not existed, please double check.
   
   FYI: https://shardingsphere.apache.org/document/current/en/faq/#12-why-are-the-default-distributed-auto-augment-key-strategy-provided-by-shardingsphere-not-continuous-and-most-of-them-end-with-even-numbers


-- 
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



[GitHub] [shardingsphere] ddx10000 commented on issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
ddx10000 commented on issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732#issuecomment-860619540


   shardingsphere version: 5.0.0-RC1-SNAPSHOT
   shardingsphere-example version: 5.0.0-alpha
   
   


-- 
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



[GitHub] [shardingsphere] RaigorJiang commented on issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732#issuecomment-924791387


   It is not a bug, we will close this issue. 
   If you are willing to improve the example, please submit another issue, thank you!


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ddx10000 closed issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
ddx10000 closed issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732


   


-- 
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



[GitHub] [shardingsphere] RaigorJiang closed issue #10732: SNOWFLAKE algorithm causes data skew.

Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #10732:
URL: https://github.com/apache/shardingsphere/issues/10732


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org