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/07/26 09:54:41 UTC

[GitHub] [shardingsphere] zjcnb opened a new issue, #19579: IllegalStateException occurred when CREATE SHADOW ALGORITHM

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   master https://github.com/apache/shardingsphere/commit/20fbf141f7057f593af7742878c562f3e7273991
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   `ShardingSphere-Proxy`
   
   ### Expected behavior
   
   `CREATE SHADOW ALGORITHM ` successful
   
   ### Actual behavior
   
   ```
   mysql> show databases;
   +--------------------+
   | schema_name        |
   +--------------------+
   | information_schema |
   | performance_schema |
   | mysql              |
   | sys                |
   +--------------------+
   4 rows in set (0.02 sec)
   
   mysql> CREATE DATABASE shadow_db;
   Query OK, 0 rows affected (0.07 sec)
   
   mysql> show databases;
   +--------------------+
   | schema_name        |
   +--------------------+
   | shadow_db          |
   | information_schema |
   | performance_schema |
   | mysql              |
   | sys                |
   +--------------------+
   5 rows in set (0.00 sec)
   
   mysql> use shadow_db;
   Database changed
   mysql> CREATE SHADOW ALGORITHM
       -> (simple_hint_algorithm, TYPE(NAME=SIMPLE_HINT, PROPERTIES("shadow"="true", "foo"="bar"))),
       -> (user_id_match_algorithm, TYPE(NAME=REGEX_MATCH,PROPERTIES("operation"="insert", "column"="user_id", "regex"='[1]')));
   ERROR 1997 (C1997): Runtime exception: [No available shadow data sources mappings in shadow configuration.]
   ```
   
   ```
   java.lang.IllegalStateException: No available shadow data sources mappings in shadow configuration.
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
   	at org.apache.shardingsphere.shadow.checker.AbstractShadowRuleConfigurationChecker.sizeCheck(AbstractShadowRuleConfigurationChecker.java:51)
   	at org.apache.shardingsphere.shadow.checker.ShadowRuleConfigurationChecker.checkShadowRuleConfiguration(ShadowRuleConfigurationChecker.java:39)
   	at org.apache.shardingsphere.shadow.checker.ShadowRuleConfigurationChecker.checkShadowRuleConfiguration(ShadowRuleConfigurationChecker.java:31)
   	at org.apache.shardingsphere.shadow.checker.AbstractShadowRuleConfigurationChecker.check(AbstractShadowRuleConfigurationChecker.java:45)
   	at org.apache.shardingsphere.infra.rule.builder.database.DatabaseRulesBuilder.lambda$build$0(DatabaseRulesBuilder.java:57)
   	at java.base/java.util.Optional.ifPresent(Optional.java:183)
   	at org.apache.shardingsphere.infra.rule.builder.database.DatabaseRulesBuilder.build(DatabaseRulesBuilder.java:57)
   	at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase.create(ShardingSphereDatabase.java:86)
   	at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.create(ShardingSphereDatabasesFactory.java:51)
   	at org.apache.shardingsphere.mode.manager.ContextManager.createChangedDatabases(ContextManager.java:327)
   	at org.apache.shardingsphere.mode.manager.ContextManager.createMetaDataContexts(ContextManager.java:311)
   	at org.apache.shardingsphere.mode.manager.ContextManager.alterRuleConfiguration(ContextManager.java:253)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule.RuleDefinitionBackendHandler.processSQLStatement(RuleDefinitionBackendHandler.java:121)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule.RuleDefinitionBackendHandler.execute(RuleDefinitionBackendHandler.java:89)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule.RuleDefinitionBackendHandler.execute(RuleDefinitionBackendHandler.java:60)
   	at org.apache.shardingsphere.proxy.backend.text.DatabaseRequiredBackendHandler.execute(DatabaseRequiredBackendHandler.java:51)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:94)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:112)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   
   ```


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


[GitHub] [shardingsphere] soulasuna closed issue #19579: IllegalStateException occurred when CREATE SHADOW ALGORITHM

Posted by GitBox <gi...@apache.org>.
soulasuna closed issue #19579: IllegalStateException occurred when CREATE SHADOW ALGORITHM
URL: https://github.com/apache/shardingsphere/issues/19579


-- 
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] soulasuna commented on issue #19579: IllegalStateException occurred when CREATE SHADOW ALGORITHM

Posted by GitBox <gi...@apache.org>.
soulasuna commented on issue #19579:
URL: https://github.com/apache/shardingsphere/issues/19579#issuecomment-1201028657

   Fixed.
   ![image](https://user-images.githubusercontent.com/33794770/182131211-cfa139ab-4b30-4c56-b231-751639945382.png)
   


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