question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When use SS & openGaussDB , exception occur.

See original GitHub issue

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

we find java version: java8, full_version=1.8.0_131
ShardingSphere-5.1.2-SNAPSHOT
Commit ID: dirty-1b77c33983198a420e974a302d2a891ca05ae664
Commit Message: Support openGauss cursor, close, move and fetch statements route and rewrite in sharding scenario (#18148)
Branch: 1b77c33983198a420e974a302d2a891ca05ae664
Build time: 2022-06-02T15:58:32+0800

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

no errors

Actual behavior

- everything you need to get the most out of using Atomikos!
[INFO ] 2022-06-03 16:29:27.677 [main] o.a.s.p.v.ShardingSphereProxyVersion - Database name is `PostgreSQL`, version is `9.2.4`, database name is `test`
[INFO ] 2022-06-03 16:29:27.897 [main] o.a.s.p.frontend.ShardingSphereProxy - ShardingSphere-Proxy Memory mode started successfully
[ERROR] 2022-06-03 16:29:34.161 [Connection-93-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
java.lang.NullPointerException: null
    at org.apache.shardingsphere.sharding.rule.ShardingRule.findTableRule(ShardingRule.java:398)
    at org.apache.shardingsphere.sharding.rule.ShardingRule.getJoinConditionTables(ShardingRule.java:803)
    at org.apache.shardingsphere.sharding.rule.ShardingRule.isJoinConditionContainsShardingColumns(ShardingRule.java:782)
    at org.apache.shardingsphere.sharding.rule.ShardingRule.isAllBindingTables(ShardingRule.java:483)
    at org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRouteEngineForShardingTable(ShardingRouteEngineFactory.java:202)
    at org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRoutingEngine(ShardingRouteEngineFactory.java:196)
    at org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.newInstance(ShardingRouteEngineFactory.java:102)
    at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:57)
    at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:45)
    at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:68)
    at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:53)
    at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54)
    at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46)
    at org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:124)
    at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.JDBCPortal.bind(JDBCPortal.java:131)
    at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.bind.PostgreSQLComBindExecutor.execute(PostgreSQLComBindExecutor.java:54)
    at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.PostgreSQLAggregatedCommandExecutor.execute(PostgreSQLAggregatedCommandExecutor.java:41)
    at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:106)
    at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:76)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
[ERROR] 2022-06-03 16:29:34.197 [Connection-184-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
java.lang.NullPointerException: null
    at org.apache.shardingsphere.sharding.rule.ShardingRule.findTableRule(ShardingRule.java:398)
    at org.apache.shardingsphere.sharding.rule.ShardingRule.getJoinConditionTables(ShardingRule.java:803)
    at org.apache.shardingsphere.sharding.rule.ShardingRule.isJoinConditionContainsShardingColumns(ShardingRule.java:782)
    at org.apache.shardingsphere.sharding.rule.ShardingRule.isAllBindingTables(ShardingRule.java:483)
    at org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRouteEngineForShardingTable(ShardingRouteEngineFactory.java:202)
    at org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.getDQLRoutingEngine(ShardingRouteEngineFactory.java:196)
    at org.apache.shardingsphere.sharding.route.engine.type.ShardingRouteEngineFactory.newInstance(ShardingRouteEngineFactory.java:102)
    at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:57)

Reason analyze (If you can)

My test program uses the openGauss postgres library, which contains the gaussdb schema by default. At the same time, our username is also gaussdb, which will implicitly trigger the search path logic of the underlying database. All the test tables were created in the gaussdb schema. During the pressure test, SS did not implement the search path function, and the tables were searched in the public schema by default, so an exception occurred.

Maybe ShardingSphere currently does not support the search path feature now.

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

config-sharding.yaml

schemaName: test

dataSources:
  ds_0:
    url: jdbc:postgresql://ip:5555/postgres
    username: gaussdb
    password: 
    connectionTimeoutMilliseconds: 30000
    idleTimeoutMilliseconds: 60000
    maxLifetimeMilliseconds: 1800000
    maxPoolSize: 3000
    minPoolSize: 1


rules:
  - !SHARDING
    bindingTables:
      - bmsql_warehouse, bmsql_customer
      - bmsql_stock, bmsql_district, bmsql_order_line
    defaultDatabaseStrategy:
      none:
    defaultTableStrategy:
      none:
    keyGenerators:
      snowflake:
        type: SNOWFLAKE
    tables:
      bmsql_config:
        actualDataNodes: ds_0.bmsql_config

      bmsql_warehouse:
        actualDataNodes: ds_0.bmsql_warehouse
        databaseStrategy:
          standard:
            shardingColumn: w_id
            shardingAlgorithmName: mod_1

      bmsql_district:
        actualDataNodes: ds_0.bmsql_district
        databaseStrategy:
          standard:
            shardingColumn: d_w_id
            shardingAlgorithmName: mod_1

      bmsql_customer:
        actualDataNodes: ds_0.bmsql_customer
        databaseStrategy:
          standard:
            shardingColumn: c_w_id
            shardingAlgorithmName: mod_1

...

server.yaml

rules:
  - !AUTHORITY
    users:
      - root@%:root
    provider:
      type: ALL_PRIVILEGES_PERMITTED


props:

Example codes for reproduce this issue (such as a github link).

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Oct 8, 2022

Hello , this issue has not received a reply for several days. This issue is supposed to be closed.

0reactions
zhaojinchao95commented, Nov 21, 2022

@wsm12138 Hi, The Memory mode are removed in master branch. I can’t reproduce this problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exceptions pertaining to data access - IBM
This situation can occur for many reasons, including the following: The application tries to get a connection and fails, as when the database...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found