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 2020/08/25 11:36:25 UTC

[GitHub] [shardingsphere] pengzhiming-sys opened a new issue #7067: Sharding-Proxy Proxy PG error

pengzhiming-sys opened a new issue #7067:
URL: https://github.com/apache/shardingsphere/issues/7067


   Bug Report
   Which version of ShardingSphere did you use?
   4.1.1
   
   Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-Sharding-Proxy
   use a PG client or library to connect to proxy
   server.yaml:
   
   authentication:
   users:
   root:
   password: root
   sharding:
   password: sharding
   authorizedSchemas: sharding_pg
   
   props:
   max.connections.size.per.query: 1
   acceptor.size: 16 # The default value is available processors count * 2.
   executor.size: 16 # Infinite by default.
   proxy.frontend.flush.threshold: 128 # The default value is 128.
   
   # LOCAL: Proxy will run with LOCAL transaction.
   # XA: Proxy will run with XA transaction.
   # BASE: Proxy will run with B.A.S.E transaction.
   proxy.transaction.type: LOCAL
   proxy.opentracing.enabled: false
   proxy.hint.enabled: false
   query.with.cipher.column: true
   sql.show: false
   allow.range.query.with.inline.sharding: false
   
   config-sharding.yaml :
   
   schemaName: sharding_pg
   
   dataSources:
   ds_0:
   url: jdbc:postgresql://172.22.2.21:5432/o3test?currentSchema=public&serverTimezone=UTC&useSSL=false
   username: poc_cnoss_sub
   password: poc_cnoss_sub
   connectionTimeoutMilliseconds: 30000
   idleTimeoutMilliseconds: 60000
   maxLifetimeMilliseconds: 1800000
   maxPoolSize: 50
   ds_1:
   url: jdbc:postgresql://172.22.2.21:5432/itsp?currentSchema=public&serverTimezone=UTC&useSSL=false
   username: poc_cnoss_sub
   password: poc_cnoss_sub
   connectionTimeoutMilliseconds: 30000
   idleTimeoutMilliseconds: 60000
   maxLifetimeMilliseconds: 1800000
   maxPoolSize: 50
   
   shardingRule:
   tables:
   lab_labelcatalog:
   actualDataNodes: ds_${0..1}.lab_labelcatalog_${0}
   databaseStrategy:
   inline:
   shardingColumn: catalogId
   algorithmExpression: ds_${catalogId % 2}
   tableStrategy:
   inline:
   shardingColumn: uuid
   algorithmExpression: lab_labelcatalog_${uuid % 2}
   
   use a PG client or library to connect to proxy show err_log:
   line 1:42 no viable alternative at input '(catalogid,uuid'
   line 1:42 no viable alternative at input '(catalogid,uuid'
   [ERROR] 15:02:52.174 [pool-8-thread-1] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
   java.lang.NullPointerException: null
   at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   at org.apache.shardingsphere.sql.parser.postgresql.visitor.impl.PostgreSQLDMLVisitor.visitInsert(PostgreSQLDMLVisitor.java:118)
   at org.apache.shardingsphere.sql.parser.postgresql.visitor.impl.PostgreSQLDMLVisitor.visitInsert(PostgreSQLDMLVisitor.java:112)
   at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$InsertContext.accept(PostgreSQLStatementParser.java:625)
   at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:80)
   at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61)
   at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.query.binary.parse.PostgreSQLComParseExecutor.execute(PostgreSQLComParseExecutor.java:53)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
   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)
   [ERROR] 15:02:52.175 [pool-8-thread-1] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
   java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.rangeCheck(ArrayList.java:657)
   at java.util.ArrayList.get(ArrayList.java:433)
   at org.apache.shardingsphere.database.protocol.postgresql.packet.command.query.binary.bind.PostgreSQLComBindPacket.getParameters(PostgreSQLComBindPacket.java:74)
   at org.apache.shardingsphere.database.protocol.postgresql.packet.command.query.binary.bind.PostgreSQLComBindPacket.(PostgreSQLComBindPacket.java:61)
   at org.apache.shardingsphere.database.protocol.postgresql.packet.command.PostgreSQLCommandPacketFactory.newInstance(PostgreSQLCommandPacketFactory.java:57)
   at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getCommandPacket(PostgreSQLCommandExecuteEngine.java:55)
   at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getCommandPacket(PostgreSQLCommandExecuteEngine.java:46)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:91)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
   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)
   
   


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

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



[GitHub] [shardingsphere] pengzhiming-sys commented on issue #7067: Sharding-Proxy Proxy PG error

Posted by GitBox <gi...@apache.org>.
pengzhiming-sys commented on issue #7067:
URL: https://github.com/apache/shardingsphere/issues/7067#issuecomment-679976014


      insert into lab_labelcatalog (catalogid,uuid, catalogcode, catalogname, 
         catalogdesc, parentid, sortnum, 
         labsysid)
       values (#{catalogid,jdbcType=INTEGER}, #{uuid,jdbcType=INTEGER},#{catalogcode,jdbcType=VARCHAR}, #{catalogname,jdbcType=VARCHAR}, 
         #{catalogdesc,jdbcType=VARCHAR}, #{parentid,jdbcType=VARCHAR}, #{sortnum,jdbcType=INTEGER}, 
         #{labsysid,jdbcType=VARCHAR})


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

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



[GitHub] [shardingsphere] pengzhiming-sys removed a comment on issue #7067: Sharding-Proxy Proxy PG error

Posted by GitBox <gi...@apache.org>.
pengzhiming-sys removed a comment on issue #7067:
URL: https://github.com/apache/shardingsphere/issues/7067#issuecomment-679975850


      insert into lab_labelcatalog_0 (catalogid,uuid, catalogcode, catalogname, 
         catalogdesc, parentid, sortnum, 
         labsysid)
       values (#{catalogid,jdbcType=INTEGER}, #{uuid,jdbcType=INTEGER},#{catalogcode,jdbcType=VARCHAR}, #{catalogname,jdbcType=VARCHAR}, 
         #{catalogdesc,jdbcType=VARCHAR}, #{parentid,jdbcType=VARCHAR}, #{sortnum,jdbcType=INTEGER}, 
         #{labsysid,jdbcType=VARCHAR})


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

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



[GitHub] [shardingsphere] terrymanu commented on issue #7067: Sharding-Proxy Proxy PG error

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


   What is the SQL do you use?


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

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



[GitHub] [shardingsphere] pengzhiming-sys commented on issue #7067: Sharding-Proxy Proxy PG error

Posted by GitBox <gi...@apache.org>.
pengzhiming-sys commented on issue #7067:
URL: https://github.com/apache/shardingsphere/issues/7067#issuecomment-680003473


   line 1:42 no viable alternative at input '(catalogid,uuid'
   line 1:42 no viable alternative at input '(catalogid,uuid'
   [ERROR] 15:02:52.174 [pool-8-thread-1] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
   java.lang.NullPointerException: null
   at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   at org.apache.shardingsphere.sql.parser.postgresql.visitor.impl.PostgreSQLDMLVisitor.visitInsert(PostgreSQLDMLVisitor.java:118)
   at org.apache.shardingsphere.sql.parser.postgresql.visitor.impl.PostgreSQLDMLVisitor.visitInsert(PostgreSQLDMLVisitor.java:112)
   at org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser$InsertContext.accept(PostgreSQLStatementParser.java:625)
   at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:80)
   at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61)
   at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.query.binary.parse.PostgreSQLComParseExecutor.execute(PostgreSQLComParseExecutor.java:53)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
   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)
   [ERROR] 15:02:52.175 [pool-8-thread-1] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
   java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.rangeCheck(ArrayList.java:657)
   at java.util.ArrayList.get(ArrayList.java:433)
   at org.apache.shardingsphere.database.protocol.postgresql.packet.command.query.binary.bind.PostgreSQLComBindPacket.getParameters(PostgreSQLComBindPacket.java:74)
   at org.apache.shardingsphere.database.protocol.postgresql.packet.command.query.binary.bind.PostgreSQLComBindPacket.(PostgreSQLComBindPacket.java:61)
   at org.apache.shardingsphere.database.protocol.postgresql.packet.command.PostgreSQLCommandPacketFactory.newInstance(PostgreSQLCommandPacketFactory.java:57)
   at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getCommandPacket(PostgreSQLCommandExecuteEngine.java:55)
   at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getCommandPacket(PostgreSQLCommandExecuteEngine.java:46)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:91)
   at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
   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)


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

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



[GitHub] [shardingsphere] pengzhiming-sys commented on issue #7067: Sharding-Proxy Proxy PG error

Posted by GitBox <gi...@apache.org>.
pengzhiming-sys commented on issue #7067:
URL: https://github.com/apache/shardingsphere/issues/7067#issuecomment-680417191


   The proxy service can be normal, but an error occurs when executing SQL through the client
   The server.yaml and config-sharding.yaml configuration files are all configured as follows:
   authentication:
     users:
       root:
         password: root
       sharding:
         password: sharding 
         authorizedSchemas: sharding_pg
   
   props:
     max.connections.size.per.query: 1
     acceptor.size: 16  # The default value is available processors count * 2.
     executor.size: 16  # Infinite by default.
     proxy.frontend.flush.threshold: 128  # The default value is 128.
     proxy.transaction.type: LOCAL
     proxy.opentracing.enabled: false
     proxy.hint.enabled: false
     query.with.cipher.column: true
     sql.show: false
     allow.range.query.with.inline.sharding: false
   
   
   schemaName: sharding_pg
   
   dataSources:
     ds_0:
       url: jdbc:postgresql://172.22.2.21:5432/o3test?currentSchema=public&serverTimezone=UTC&useSSL=false
       username: poc_cnoss_sub
       password: poc_cnoss_sub
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
     ds_1:
       url: jdbc:postgresql://172.22.2.21:5432/itsp?currentSchema=public&serverTimezone=UTC&useSSL=false
       username: poc_cnoss_sub
       password: poc_cnoss_sub
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   shardingRule:
     tables:
       lab_labelcatalog:
         actualDataNodes: ds_${0..1}.lab_labelcatalog_${0}
         databaseStrategy:
           inline:
             shardingColumn: catalogId
             algorithmExpression: ds_${catalogId % 2}
         tableStrategy:
           inline:
             shardingColumn: uuid
             algorithmExpression: lab_labelcatalog_${uuid % 2}
   
   


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

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



[GitHub] [shardingsphere] pengzhiming-sys commented on issue #7067: Sharding-Proxy Proxy PG error

Posted by GitBox <gi...@apache.org>.
pengzhiming-sys commented on issue #7067:
URL: https://github.com/apache/shardingsphere/issues/7067#issuecomment-679975850


      insert into lab_labelcatalog_0 (catalogid,uuid, catalogcode, catalogname, 
         catalogdesc, parentid, sortnum, 
         labsysid)
       values (#{catalogid,jdbcType=INTEGER}, #{uuid,jdbcType=INTEGER},#{catalogcode,jdbcType=VARCHAR}, #{catalogname,jdbcType=VARCHAR}, 
         #{catalogdesc,jdbcType=VARCHAR}, #{parentid,jdbcType=VARCHAR}, #{sortnum,jdbcType=INTEGER}, 
         #{labsysid,jdbcType=VARCHAR})


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

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



[GitHub] [shardingsphere] tristaZero closed issue #7067: Sharding-Proxy Proxy PG error

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


   


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

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



[GitHub] [shardingsphere] terrymanu commented on issue #7067: Sharding-Proxy Proxy PG error

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


   Can you provide the log of `sql.show`?


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

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