Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
Successful routing and sharding in multithreaded situations
Actual behavior
When I want to enhance datax(DataX is an open-source tool for offline synchronization of heterogeneous data sources from Alibaba), the following error occurs, but it is successful occasionally
org.apache.shardingsphere.sharding.exception.algorithm.sharding.ShardingRouteAlgorithmException: Routed target `ds0` does not exist, available targets are `[cmp_contract_0, cmp_contract_2, cmp_contract_4, cmp_contract_6]`.
at org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:80)
at org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:64)
at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeTables(ShardingStandardRoutingEngine.java:273)
at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route0(ShardingStandardRoutingEngine.java:252)
at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditionsWithCondition(ShardingStandardRoutingEngine.java:142)
at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditions(ShardingStandardRoutingEngine.java:135)
at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.getDataNodes(ShardingStandardRoutingEngine.java:102)
at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route(ShardingStandardRoutingEngine.java:84)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext0(ShardingSQLRouter.java:71)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:59)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:47)
at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:69)
at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:57)
at org.apache.shardingsphere.infra.connection.kernel.KernelProcessor.route(KernelProcessor.java:60)
at org.apache.shardingsphere.infra.connection.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:51)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:554)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.addBatch(ShardingSpherePreparedStatement.java:642)
Reason analyze (If you can)
DataX is based on multi-threaded task execution. I think it is caused by thread synchronization issues.
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Bug Report
Which version of ShardingSphere did you use?
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
Successful routing and sharding in multithreaded situations
Actual behavior
When I want to enhance datax(DataX is an open-source tool for offline synchronization of heterogeneous data sources from Alibaba), the following error occurs, but it is successful occasionally
Reason analyze (If you can)
DataX is based on multi-threaded task execution. I think it is caused by thread synchronization issues.
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
This is the code for getting the data source
This is the code for datax batch insert
The corresponding implementation of PreparedStatement is ShardingSpherePreparedStatement. Here is a debug screenshot
This is my config file
Example codes for reproduce this issue (such as a github link).