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/20 07:06:02 UTC

[GitHub] [shardingsphere] wsm12138 commented on issue #19224: Use DistSQL add resource have unexpected behavior

wsm12138 commented on issue #19224:
URL: https://github.com/apache/shardingsphere/issues/19224#issuecomment-1189908157

   <img width="1681" alt="image" src="https://user-images.githubusercontent.com/86462784/179918206-16624db1-ef2d-46a2-b285-59b784d5327d.png">
   
   ### stdout.log
   
   ```
   [ERROR] 2022-07-20 14:58:22.059 [Connection-2-ThreadExecutor] o.a.s.p.b.t.d.r.r.AddResourceBackendHandler - Add resource failed
   java.lang.reflect.InvocationTargetException: null
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.apache.shardingsphere.transaction.xa.jta.datasource.swapper.DataSourceSwapper.setProperties(DataSourceSwapper.java:118)
           at org.apache.shardingsphere.transaction.xa.jta.datasource.swapper.DataSourceSwapper.swap(DataSourceSwapper.java:57)
           at org.apache.shardingsphere.transaction.xa.jta.datasource.XADataSourceFactory.build(XADataSourceFactory.java:43)
           at org.apache.shardingsphere.transaction.xa.jta.datasource.XATransactionDataSource.<init>(XATransactionDataSource.java:65)
           at org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.newXATransactionDataSource(XAShardingSphereTransactionManager.java:62)
           at org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.lambda$init$0(XAShardingSphereTransactionManager.java:56)
           at java.util.ArrayList.forEach(ArrayList.java:1259)
           at org.apache.shardingsphere.transaction.xa.XAShardingSphereTransactionManager.init(XAShardingSphereTransactionManager.java:56)
           at org.apache.shardingsphere.transaction.ShardingSphereTransactionManagerEngine.lambda$init$0(ShardingSphereTransactionManagerEngine.java:66)
           at java.util.Map.forEach(Map.java:630)
           at org.apache.shardingsphere.transaction.ShardingSphereTransactionManagerEngine.init(ShardingSphereTransactionManagerEngine.java:66)
           at org.apache.shardingsphere.transaction.rule.TransactionRule.createTransactionManagerEngine(TransactionRule.java:76)
           at org.apache.shardingsphere.transaction.rule.TransactionRule.rebuildEngine(TransactionRule.java:110)
           at org.apache.shardingsphere.transaction.rule.TransactionRule.addResource(TransactionRule.java:87)
           at org.apache.shardingsphere.mode.manager.ContextManager.lambda$updateResources$3(ContextManager.java:208)
           at java.lang.Iterable.forEach(Iterable.java:75)
           at org.apache.shardingsphere.mode.manager.ContextManager.updateResources(ContextManager.java:208)
           at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.resource.AddResourceBackendHandler.execute(AddResourceBackendHandler.java:63)
           at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.resource.AddResourceBackendHandler.execute(AddResourceBackendHandler.java:44)
           at org.apache.shardingsphere.proxy.backend.text.DatabaseRequiredBackendHandler.execute(DatabaseRequiredBackendHandler.java:51)
           at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.simple.PostgreSQLComQueryExecutor.execute(PostgreSQLComQueryExecutor.java:79)
           at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:108)
           at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
           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)
   Caused by: java.lang.IllegalArgumentException: URL invalid jdbc:opengauss://[ip:5432/postgres](http://ip:5432/postgres)
           at org.postgresql.ds.common.BaseDataSource.setUrl(BaseDataSource.java:1313)
           ... 30 common frames omitted
   [ERROR] 2022-07-20 14:58:22.060 [Connection-2-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   org.apache.shardingsphere.infra.distsql.exception.resource.InvalidResourcesException: Can not process invalid resources, error messages are: [null].
           at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.resource.AddResourceBackendHandler.execute(AddResourceBackendHandler.java:68)
           at org.apache.shardingsphere.proxy.backend.text.distsql.rdl.resource.AddResourceBackendHandler.execute(AddResourceBackendHandler.java:44)
           at org.apache.shardingsphere.proxy.backend.text.DatabaseRequiredBackendHandler.execute(DatabaseRequiredBackendHandler.java:51)
           at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.simple.PostgreSQLComQueryExecutor.execute(PostgreSQLComQueryExecutor.java:79)
           at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:108)
           at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
           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)
   ```
   
   ### server.yaml
   ```
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: 0720distsql
         server-lists: 192.168.10.21:2181
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         operationTimeoutMilliseconds: 500
     overwrite: true
   
   rules:
   - !AUTHORITY
     users:
       - root@%:root
       - sharding@:sharding
     provider:
       type: ALL_PERMITTED
   - !SQL_PARSER
     sqlCommentParseEnabled: true
     sqlStatementCache:
       initialCapacity: 2000
       maximumSize: 65535
     parseTreeCache:
       initialCapacity: 128
       maximumSize: 1024
   
   props:
     proxy-frontend-database-protocol-type: "PostgreSQL"
   ```


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