jianliu opened a new issue #10746:
URL: https://github.com/apache/shardingsphere/issues/10746


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master branch
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy & governance
   
   ### Expected behavior
   table columns:
   -  id(bigint)
   -  create_at(datetime)
   
   This is my config rules:
   ``` 
   - !SHARDING
     tables:
       fixed_test:
         actualDataNodes: ds_0.fixed_test_${0..1},ds_1.fixed_test_${2..3}
         tableStrategy:
           standard:
             shardingAlgorithmName: fixed_test_hash_mod
             shardingColumn: id
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       range_test:
         actualDataNodes: ds_0.range_test_${0..4},ds_1.range_test_${5..9}
         tableStrategy:
           standard:
             shardingAlgorithmName: range_test_volume_range
             shardingColumn: level
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
       time_test:
         actualDataNodes: 
ds_0.time_test_2021062,ds_0.time_test_2021063,ds_1.time_test_2021064,ds_1.time_test_2021071
         tableStrategy:
           standard: 
             shardingAlgorithmName: time_test_interval
             shardingColumn: create_at
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
     shardingAlgorithms:
       fixed_test_hash_mod:
         type: HASH_MOD
         props:
           sharding-count: 4
       range_test_volume_range:
         type: VOLUME_RANGE
         props:
           range-lower: 1
           range-upper: 1000
           sharding-volume: 100
       time_test_interval:
         type: INTERVAL
         props:
           datetime-lower: '2021-06-13 00:00:01'
           datetime-interval-unit: weeks
           datetime-interval-amount: 1
           datetime-pattern: yyyy-MM-dd HH:mm:ss
           sharding-suffix-pattern: yyyyMMW
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
       uuid:
         type: uuid
   
   ```  
   
   sql:
   ``` 
   INSERT INTO `time_test` (`create_at`) VALUES ('2021-06-13 03:01:01');
   ```
   expect insert success
   
   ### Actual behavior
   <e>查询:insert into `time_test` (`create_at`) values ('2021-06-13 03:01:01')
   
   错误代码: 1999
   Unknown exception: [failed to shard value 
PreciseShardingValue(logicTableName=time_test, columnName=create_at, 
value=2021-06-13 03:01:01), and availableTables [time_test_2021064, 
time_test_2021071]]
   
   ### Reason analyze (If you can)
   
![image](https://user-images.githubusercontent.com/1589099/121461902-532a3900-c9e2-11eb-8330-a63b74d9c862.png)
   why:
   because there is not db routed,so both ds_0 and ds_1 will enter this code 
span and make this error finally.
   ps:
   doSharding with PreciseShardingValue should only return one datanodes
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   
   IntervalShardingAlgorithm do not throw exception ,and check preciseSharding 
result at parent invoke span.
   If you think this is a problem,I`d like to resolve it
   


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


Reply via email to