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 08:40:29 UTC
[GitHub] [shardingsphere] pengzhiming-sys opened a new issue #7056: ShardingSphere-Proxy 代理 PostgreSQL出错
pengzhiming-sys opened a new issue #7056:
URL: https://github.com/apache/shardingsphere/issues/7056
## Bug Report
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}
出错如下:
org.apache.shardingsphere.underlying.common.config.exception.ShardingSphereConfigurationException: Cannot find table rule and default data source with logic table: 'pg_type'
at org.apache.shardingsphere.core.rule.ShardingRule.getTableRule(ShardingRule.java:166)
at org.apache.shardingsphere.sharding.route.engine.type.unicast.ShardingUnicastRoutingEngine.route(ShardingUnicastRoutingEngine.java:72)
at org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:69)
at org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:53)
at org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:91)
at org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76)
at org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54)
at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96)
at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83)
at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.PreparedStatementExecutorWrapper.doShardingRoute(PreparedStatementExecutorWrapper.java:83)
at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.PreparedStatementExecutorWrapper.route(PreparedStatementExecutorWrapper.java:66)
at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:74)
at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.query.binary.bind.PostgreSQLComBindExecutor.execute(PostgreSQLComBindExecutor.java:81)
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:01:48.001 [pool-8-thread-1] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
org.apache.shardingsphere.underlying.common.config.exception.ShardingSphereConfigurationException: Cannot find table rule and default data source with logic table: 'pg_type'
at org.apache.shardingsphere.core.rule.ShardingRule.getTableRule(ShardingRule.java:166)
at org.apache.shardingsphere.sharding.route.engine.type.unicast.ShardingUnicastRoutingEngine.route(ShardingUnicastRoutingEngine.java:72)
at org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:69)
at org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:53)
at org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:91)
at org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76)
at org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54)
at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96)
at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83)
at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.PreparedStatementExecutorWrapper.doShardingRoute(PreparedStatementExecutorWrapper.java:83)
at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.PreparedStatementExecutorWrapper.route(PreparedStatementExecutorWrapper.java:66)
at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:74)
at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.query.binary.bind.PostgreSQLComBindExecutor.execute(PostgreSQLComBindExecutor.java:81)
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)
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.<init>(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)
> #[](url)
----------------------------------------------------------------
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 #7056: ShardingSphere-Proxy 代理 PostgreSQL出错
Posted by GitBox <gi...@apache.org>.
pengzhiming-sys commented on issue #7056:
URL: https://github.com/apache/shardingsphere/issues/7056#issuecomment-679930345
version:apache-shardingsphere-4.1.1
PG cliento connect to proxy
----------------------------------------------------------------
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 #7056: ShardingSphere-Proxy 代理 PostgreSQL出错
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #7056:
URL: https://github.com/apache/shardingsphere/issues/7056#issuecomment-679928153
**For English only**, other languages will not accept.
----------------------------------------------------------------
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 closed issue #7056: ShardingSphere-Proxy 代理 PostgreSQL出错
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #7056:
URL: https://github.com/apache/shardingsphere/issues/7056
----------------------------------------------------------------
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] kimmking commented on issue #7056: ShardingSphere-Proxy 代理 PostgreSQL出错
Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #7056:
URL: https://github.com/apache/shardingsphere/issues/7056#issuecomment-679916924
hi, @pengzhiming-sys , we need more info:
1. which version
2. the logic sql and actual sql executed when throws exception
3. did you use a PG client or library to connect to proxy?
----------------------------------------------------------------
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