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 2022/02/23 09:52:22 UTC

[GitHub] [shardingsphere] zjcnb opened a new issue #15585: Build `DatabaseDiscoveryRule`are failed when create discovery type by `DistSQL`.

zjcnb opened a new issue #15585:
URL: https://github.com/apache/shardingsphere/issues/15585


   ### Which version of ShardingSphere did you use?
   
   `master`
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   `ShardingSphere-Proxy`
   
   ### Expected behavior
   
   Execute `DistSQL` success
   ```
   CREATE DB_DISCOVERY TYPE mgr(
     TYPE(NAME=mgr,PROPERTIES('group-name'='b13df29e-90b6-11e8-8d1b-525400fc3996'))
   );
   ```
   
   ### Actual behavior
   
   ```
   java.lang.IllegalStateException: Data source can not be empty.
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
   	at org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule.<init>(DatabaseDiscoveryRule.java:84)
   	at org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule.<init>(DatabaseDiscoveryRule.java:75)
   	at org.apache.shardingsphere.dbdiscovery.rule.builder.DatabaseDiscoveryRuleBuilder.build(DatabaseDiscoveryRuleBuilder.java:47)
   	at org.apache.shardingsphere.dbdiscovery.rule.builder.DatabaseDiscoveryRuleBuilder.build(DatabaseDiscoveryRuleBuilder.java:36)
   	at org.apache.shardingsphere.infra.rule.builder.schema.SchemaRulesBuilder.buildRules(SchemaRulesBuilder.java:63)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsBuilder.getSchemaRules(MetaDataContextsBuilder.java:85)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsBuilder.addSchema(MetaDataContextsBuilder.java:77)
   	at org.apache.shardingsphere.mode.manager.ContextManager.buildChangedMetaDataContext(ContextManager.java:481)
   	at org.apache.shardingsphere.mode.manager.ContextManager.alterRuleConfiguration(ContextManager.java:263)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule.RuleDefinitionBackendHandler.processSQLStatement(RuleDefinitionBackendHandler.java:118)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule.RuleDefinitionBackendHandler.execute(RuleDefinitionBackendHandler.java:93)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule.RuleDefinitionBackendHandler.execute(RuleDefinitionBackendHandler.java:59)
   	at org.apache.shardingsphere.proxy.backend.text.SchemaRequiredBackendHandler.execute(SchemaRequiredBackendHandler.java:51)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:62)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:96)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:69)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   ```
   
   ### Step
   
   ```
   1. create database database_discovery_db;
   2. ADD RESOURCE ds_0 (
       HOST=xxxx,
       PORT=1231,
       DB=demo_primary_ds,
       USER=root,
       PASSWORD=123456
   );
   ADD RESOURCE ds_1 (
       HOST=xxxx,
       PORT=1232,
       DB=demo_primary_ds,
       USER=root,
       PASSWORD=123456
   );
   ADD RESOURCE ds_2 (
       HOST=xxxx,
       PORT=1233,
       DB=demo_primary_ds,
       USER=root,
       PASSWORD=123456
   );
   3. CREATE DB_DISCOVERY TYPE mgr(
     TYPE(NAME=mgr,PROPERTIES('group-name'='b13df29e-90b6-11e8-8d1b-525400fc3996'))
   );
   ```


-- 
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] strongduanmu closed issue #15585: Build `DatabaseDiscoveryRule`are failed when create discovery type by `DistSQL`.

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


   


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