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/04/22 06:45:08 UTC

[GitHub] [shardingsphere] fanfantian opened a new issue, #16998: proxy scaling error

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

   ## Bug Report
   
   version 5.1.1
   error:
   mysql> CREATE SHARDING BINDING TABLE RULES (sbtest1,sbtest2,sbtest3);
   ERROR 1997 (C1997): Runtime exception: [Invalid binding table configuration in ShardingRuleConfiguration.]
   mysql> ADD RESOURCE ds_1 (
       ->     URL="jdbc:mysql://ip:3306/sharding_ds_0?serverTimezone=UTC&useSSL=false",
       ->     USER=sharding_user,
       ->     PASSWORD=sharding_user,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ),ds_2 (
       ->     URL="jdbc:mysql://ip:3306/sharding_ds_1?serverTimezone=UTC&useSSL=false",
       ->     USER=sharding_user,
       ->     PASSWORD=sharding_user,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> );
   ERROR 1104 (C1104): Can not process invalid resources, error messages are: [Invalid binding table configuration in ShardingRuleConfiguration.].
   
   errlog:
   java.lang.IllegalArgumentException: Invalid binding table configuration in ShardingRuleConfiguration.
   	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142)
   	at org.apache.shardingsphere.sharding.rule.ShardingRule.<init>(ShardingRule.java:125)
   	at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:41)
   	at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:35)
   	at org.apache.shardingsphere.infra.rule.builder.schema.SchemaRulesBuilder.buildRules(SchemaRulesBuilder.java:63)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsBuilder.getSchemaRules(MetaDataContextsBuilder.java:105)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsBuilder.addSchema(MetaDataContextsBuilder.java:83)
   	at org.apache.shardingsphere.mode.manager.ContextManager.buildChangedMetaDataContextWithAddedDataSource(ContextManager.java:478)
   	at org.apache.shardingsphere.mode.manager.ContextManager.refreshMetaDataContext(ContextManager.java:451)
   	at org.apache.shardingsphere.mode.manager.ContextManager.addResource(ContextManager.java:232)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.resource.AddResourceBackendHandler.execute(AddResourceBackendHandler.java:64)
   	at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.resource.AddResourceBackendHandler.execute(AddResourceBackendHandler.java:45)
   	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:97)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:100)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   
   
   
   
   # how to repeat:
   ALTER RESOURCE ds_0 (
       URL="jdbc:mysql://ip:3306/sbtest?serverTimezone=UTC&useSSL=false",
       USER=sharding_user,
       PASSWORD=sharding_user,
       PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
   );
   
   把现有系统中的表配置到规则里,使用 tables 规则 INLINE 算法
   CREATE SHARDING ALGORITHM database_inline (
   TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="ds_0"))
   );
   
   CREATE SHARDING ALGORITHM sbtest1_inline (
   TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="sbtest1"))
   );
   CREATE SHARDING ALGORITHM sbtest2_inline (
   TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="sbtest2"))
   );
   CREATE SHARDING ALGORITHM sbtest3_inline (
   TYPE(NAME=INLINE,PROPERTIES("algorithm-expression"="sbtest3"))
   );
   
   CREATE SHARDING TABLE RULE sbtest1 (
   DATANODES("ds_0.sbtest1"),
   DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=k,SHARDING_ALGORITHM=database_inline),
   TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=k,SHARDING_ALGORITHM=sbtest1_inline),
   KEY_GENERATE_STRATEGY(COLUMN=k,TYPE(NAME=snowflake))
   ),sbtest2 (
   DATANODES("ds_0.sbtest2"),
   DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=k,SHARDING_ALGORITHM=database_inline),
   TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=k,SHARDING_ALGORITHM=sbtest2_inline),
   KEY_GENERATE_STRATEGY(COLUMN=k,TYPE(NAME=snowflake))
   ),sbtest3 (
   DATANODES("ds_0.sbtest3"),
   DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=k,SHARDING_ALGORITHM=database_inline),
   TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=k,SHARDING_ALGORITHM=sbtest3_inline),
   KEY_GENERATE_STRATEGY(COLUMN=k,TYPE(NAME=snowflake))
   );
   
   CREATE SHARDING BINDING TABLE RULES (sbtest1,sbtest2,sbtest3);
   


-- 
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] RaigorJiang commented on issue #16998: proxy scaling error

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

   Closed due to no reply for a long time.


-- 
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] lanchengx commented on issue #16998: proxy scaling error

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

   @tuichenchuxin Please help to confirm whether the prefix is obtained correctly.
   <img width="1147" alt="image" src="https://user-images.githubusercontent.com/52209337/167572947-c46a5782-ca8c-4b28-9240-cf01c9013b4a.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


[GitHub] [shardingsphere] tuichenchuxin commented on issue #16998: proxy scaling error

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

   @lanchengx OK, I'll check 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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] tuichenchuxin commented on issue #16998: proxy scaling error

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

   @fanfantian 
   `sbtest1` `sbtest2` `sbtest3` is all singletable. So, there is no need to config them as sharding table


-- 
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] RaigorJiang closed issue #16998: proxy scaling error

Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #16998: proxy scaling error
URL: https://github.com/apache/shardingsphere/issues/16998


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