sunguosheng opened a new issue #11452:
URL: https://github.com/apache/shardingsphere/issues/11452


   ## Bug Report
   ### Which version of ShardingSphere did you use?
   shardingjdbc4.1.1
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### bug
   Distributed system snowflake algorithm duplicate ID
   ```
   ### Error updating database. Cause: 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '624998537125429249' for key 'PRIMARY'
   ### The error may involve 
com.dongao.phoenix.biz.study.manage.mapper.MsPushRecordLinkPoMapper.insert-Inline
   ### The error occurred while setting parameters
   ### SQL: insert into biz_ms_push_record_link (ms_push_record_id, type, 
create_date, update_date, member_ids, device_tokens ) values (?, ?, ?, ?, ?, ? )
   ### Cause: 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '624998537125429249' for key 'PRIMARY'
   ; SQL []; Duplicate entry '624998537125429249' for key 'PRIMARY'; nested 
exception is 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '624998537125429249' for key 'PRIMARY' 
org.springframework.dao.DuplicateKeyException:
   ### Error updating database. Cause: 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '624998537125429249' for key 'PRIMARY'
   ### The error may involve 
com.dongao.phoenix.biz.study.manage.mapper.MsPushRecordLinkPoMapper.insert-Inline
   ### The error occurred while setting parameters
   ### SQL: insert into biz_ms_push_record_link (ms_push_record_id, type, 
create_date, update_date, member_ids, device_tokens ) values (?, ?, ?, ?, ?, ? )
   ### Cause: 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '624998537125429249' for key 'PRIMARY'
   ```
   ### configuration
   ```
   <bean id="msPushShardingAlgorithm" 
class="com.xx.phoenix.biz.study.manage.config.MsPushShardingAlgorithm" />
        <sharding:standard-strategy id="pushTableStrategy" 
sharding-column="create_date" precise-algorithm-ref="msPushShardingAlgorithm" 
range-algorithm-ref="msPushShardingAlgorithm"/>
        <sharding:key-generator id="idKeyGenerator" type="SNOWFLAKE" 
column="id"/>
   
        <sharding:data-source id="shardingDataSource">
                <sharding:sharding-rule data-source-names="ds1">
                        <sharding:table-rules>
                                <sharding:table-rule logic-table="biz_ms_push"
                                                                         
actual-data-nodes="ds1.biz_ms_push_20$->{21..25}"
                                                                         
table-strategy-ref="pushTableStrategy" key-generator-ref="idKeyGenerator"  />
                                <sharding:table-rule 
logic-table="biz_ms_push_record"
                                                                         
actual-data-nodes="ds1.biz_ms_push_record_20$->{21..25}"
                                                                         
table-strategy-ref="pushTableStrategy" key-generator-ref="idKeyGenerator"  />
                                <sharding:table-rule 
logic-table="biz_ms_push_record_link"
                                                                         
actual-data-nodes="ds1.biz_ms_push_record_link_20$->{21..25}"
                                                                         
table-strategy-ref="pushTableStrategy" key-generator-ref="idKeyGenerator"  />
                        </sharding:table-rules>
                        <sharding:binding-table-rules>
                                <sharding:binding-table-rule 
logic-tables="biz_ms_push_record" />
                        </sharding:binding-table-rules>
                </sharding:sharding-rule>
                <sharding:props>
                        <prop key="sql.show">true</prop>
                </sharding:props>
        </sharding:data-source>
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to