You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "lenxeon (via GitHub)" <gi...@apache.org> on 2024/01/22 04:47:35 UTC
[I] Routed target `tb_document_book_000` does not exist, available targets are `[tb_document_file_000, tb_document_file_001]` [shardingsphere]
lenxeon opened a new issue, #29799:
URL: https://github.com/apache/shardingsphere/issues/29799
## 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**.
with ShardingSphere-JDBC 5.4.1, use java config
my DataSource
```
@Bean("originProject")
public DataSource dataSourceProject() {
HikariDataSource ds = new HikariDataSource();
ConfigGroup configGroup = ZkConfigUtils.getConfig("mysql");
String url = MapUtils.getString(configGroup, "db.project.url");
ds.setJdbcUrl(url);
logger.info("originProject:" + url);
ds.setDriverClassName(MapUtils.getString(configGroup, "driverClassName"));
ds.setUsername(MapUtils.getString(configGroup, "username"));
ds.setPassword(MapUtils.getString(configGroup, "password"));
ds.setMaximumPoolSize(500);
ds.setMinimumIdle(16);
ds.setConnectionTimeout(60000);
return shardingDs("project", ds);
}
```
ShardingTableRuleConfiguration like this
"db_project.tb_document_file_00${[0, 1]}");
```
void factory(String schemaName, ShardingTable shardingTable) {
// result.setLogicTable(tableName);
// String act = "";
// if (getTableSize() < 256) {
// act = "db_" + schemaName + "." + tableName + "_00${0..1}";
// } else {
// act = "db_" + schemaName + "." + tableName + "_00${0..9}," + schemaName + "." + tableName + "_0${10..99}," + schemaName + "." + tableName + "_${100..255}";
// }
// logger.info("Sharding.factory:" + act);
if (shardingTable.isSharding()) {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration(shardingTable.getName(), "db_" + schemaName + "." + shardingTable.getName() + "_00${[0, 1]}");
Properties properties = new Properties();
properties.setProperty("algorithm-expression", shardingTable.getName() + "_00${organization_id % 2}");
String shardingStrategyKey = "sharding_algorithm_" + shardingTable.getName();
shardingRuleConfig.getShardingAlgorithms().put(shardingStrategyKey, new AlgorithmConfiguration("INLINE", properties));
shardingRuleConfig.getBindingTableGroups().add(new ShardingTableReferenceRuleConfiguration("db_" + schemaName, shardingTable.getName()));
result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("organization_id", shardingStrategyKey));
shardingRuleConfig.getTables().add(result);
} else {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration(shardingTable.getName(), "db_" + schemaName + "." + shardingTable.getName() + "");
Properties properties = new Properties();
properties.setProperty("algorithm-expression", shardingTable.getName() + "");
String shardingStrategyKey = "sharding_algorithm_" + shardingTable.getName();
shardingRuleConfig.getShardingAlgorithms().put(shardingStrategyKey, new AlgorithmConfiguration("INLINE", properties));
shardingRuleConfig.getBindingTableGroups().add(new ShardingTableReferenceRuleConfiguration("db_" + schemaName, shardingTable.getName()));
result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("organization_id_xxx", shardingStrategyKey));
shardingRuleConfig.getTables().add(result);
}
if (StringUtils.equals(schemaName, "uc")) {
logger.info("noShard=" + shardingTable.getName());
}
}
```
**Low probability randomness throw exception**
Routed target `tb_document_book_000` does not exist, available targets are `[tb_document_file_000, tb_document_file_001]`
but when i refresh view, it`s will run success.
Please answer these questions before submitting your issue. Thanks!
### Which version of ShardingSphere did you use?
5.4.1
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### Expected behavior
### Actual behavior
throw exception Routed target `tb_document_book_000` does not exist, available targets are `[tb_document_file_000, tb_document_file_001]`
### Reason analyze (If you can)
### 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).
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Low probability randomness throw exception Routed target `tb_document_book_000` does not exist [shardingsphere]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #29799:
URL: https://github.com/apache/shardingsphere/issues/29799#issuecomment-1960195709
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
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
Re: [I] Low probability randomness throw exception Routed target `tb_document_book_000` does not exist [shardingsphere]
Posted by "FlyingZC (via GitHub)" <gi...@apache.org>.
FlyingZC commented on issue #29799:
URL: https://github.com/apache/shardingsphere/issues/29799#issuecomment-1963784532
@lenxeon Hi,I have fixed this issue in #30295. Could you please test the latest code to see if the problem has been resolved?
--
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
Re: [I] Low probability randomness throw exception Routed target `tb_document_book_000` does not exist [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #29799: Low probability randomness throw exception Routed target `tb_document_book_000` does not exist
URL: https://github.com/apache/shardingsphere/issues/29799
--
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
Re: [I] Low probability randomness throw exception Routed target `tb_document_book_000` does not exist [shardingsphere]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #29799:
URL: https://github.com/apache/shardingsphere/issues/29799#issuecomment-2027686816
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
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