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/08/03 03:21:40 UTC

[GitHub] [shardingsphere] peilinqian opened a new issue, #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   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_282
   ShardingSphere-5.1.3-SNAPSHOT
   Commit ID: dirty-9dd0d3990c849d50c17c6dc7c92ec2d4ce0ad7e5
   Commit Message: Implements openGauss version function by calcite (#19327)
   Branch: 9dd0d3990c849d50c17c6dc7c92ec2d4ce0ad7e5
   Build time: 2022-08-02T17:55:17+0800
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   In the XA-Narayana transaction type scenario, when start a transaction and select one table,return query results normally
   ### Actual behavior
   In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist
   
   
   ```
   test_db=> begin;
   BEGIN
   test_db=> select * from t_broadcast;
   ERROR:  relation "t_broadcast" does not exist on dn_6001
   LINE 1: select * from t_broadcast;
                         ^
   test_db=> end;
   ROLLBACK
   test_db=> select * from t_broadcast;
    id
   ----
     2
   (1 row)
   
   ```
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   config:
     broadcastTables:
       - t_broadcast
   
   error log
   
   
   ```
   [INFO ] 2022-08-03 11:15:49.692 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from t_broadcast;
   [INFO ] 2022-08-03 11:15:49.692 [Connection-1-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(super=SelectStatement(super=AbstractSQLStatement(parameterCount=0, parameterMarkerSegments=[], commentSegments=[]), projections=ProjectionsSegment(startIndex=7, stopIndex=7, projections=[ShorthandProjectionSegment(startIndex=7, stopIndex=7, owner=Optional.empty, alias=Optional.empty)], distinctRow=false), from=SimpleTableSegment(tableName=TableNameSegment(startIndex=14, stopIndex=24, identifier=IdentifierValue(value=t_broadcast, quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty), where=Optional.empty, groupBy=Optional.empty, having=Optional.empty, orderBy=Optional.empty, combines=[]), limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-08-03 11:15:49.692 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from t_broadcast;
   [ERROR] 2022-08-03 11:15:49.701 [Connection-1-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   org.opengauss.util.PSQLException: [IP1:34594/IP2:14000] ERROR: relation "t_broadcast" does not exist on dn_6001
     Position: 15
           at org.opengauss.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2901)
           at org.opengauss.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2630)
           at org.opengauss.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:362)
           at org.opengauss.jdbc.PgStatement.runQueryExecutor(PgStatement.java:562)
           at org.opengauss.jdbc.PgStatement.executeInternal(PgStatement.java:539)
           at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:397)
           at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:339)
           at org.opengauss.jdbc.PgStatement.executeCachedSql(PgStatement.java:325)
           at org.opengauss.jdbc.PgStatement.executeWithFlags(PgStatement.java:302)
           at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:298)
           at org.opengauss.jdbc.PgStatement.execute(PgStatement.java:1458)
           at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:103)
           at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
           at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.impl.ProxyStatementExecutorCallback.execute(ProxyStatementExecutorCallback.java:40)
           at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:73)
           at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:66)
           at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:44)
           at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:89)
           at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:69)
           at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:135)
           at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.serialExecute(ExecutorEngine.java:121)
           at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:115)
           at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:65)
           at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:71)
           at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:173)
           at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:133)
           at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:127)
           at org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:139)
           at org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:71)
           at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.execute(SchemaAssignedDatabaseBackendHandler.java:63)
           at org.apache.shardingsphere.proxy.frontend.opengauss.command.query.simple.OpenGaussComQueryExecutor.execute(OpenGaussComQueryExecutor.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)
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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] peilinqian commented on issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   schemaName: test_db
   dataSources:
     ds_0:
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 260
       minPoolSize: 1
       password: Huawei@123
       url: jdbc:opengauss://IP:14000/test_db?batchMode=on
       username: tpccuser
     ds_1:
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 260
       minPoolSize: 1
       password: Huawei@123
       url: jdbc:opengauss://IP:14000/test_db?batchMode=on
       username: tpccuser
   rules:
   - !SHARDING
     tables:
       t_ssdb_tb:
         actualDataNodes: ds_${0..1}.t_ssdb_tb_${0..1}
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
         tableStrategy:
           standard:
             shardingColumn: c_id
             shardingAlgorithmName: ts_t_ssdb_tb_inline
       t_ssdb_tb_view:
         actualDataNodes: ds_${0..1}.t_ssdb_tb_view_${0..1}
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
         tableStrategy:
           standard:
             shardingColumn: c_id
             shardingAlgorithmName: ts_t_ssdb_tb_view_inline
       t_ssdb:
         actualDataNodes: ds_${0..1}.t_ssdb
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
       t_ssdb_view:
         actualDataNodes: ds_${0..1}.t_ssdb_view
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
       t_ssdb_tb1:
         actualDataNodes: ds_${0..1}.t_ssdb_tb1_${0..1}
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
         tableStrategy:
           standard:
             shardingColumn: c_id
             shardingAlgorithmName: ts_t_ssdb_tb1_inline
   


-- 
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] peilinqian commented on issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   ```
   schemaName: order_db
   dataSources:
     ds_0:
       url: jdbc:opengauss://10.29.180.204:14000/test_order?batchMode=on
       username: tpccuser
       password: Huawei@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 10
     ds_1:
       url: jdbc:opengauss://10.28.13.92:14000/test_order?batchMode=on
       username: tpccuser
       password: Huawei@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 10
   rules:
   - !SHARDING
     tables:
       tb_one:
         actualDataNodes: ds_0.tb_one
       t_order:
         actualDataNodes: ds_${0..1}.t_order_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
       t_order_item:
         actualDataNodes: ds_${0..1}.t_order_item_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_item_inline
         keyGenerateStrategy:
           column: order_item_id
           keyGeneratorName: snowflake
     bindingTables:
       - t_order,t_order_item
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: database_inline
     defaultTableStrategy:
       none:
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 2}
           allow-range-query-with-inline-sharding: true
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_${order_id % 2}
           allow-range-query-with-inline-sharding: true
       t_order_item_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_${order_id % 2}
           allow-range-query-with-inline-sharding: true
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123
   ```
   


-- 
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] FlyingZC commented on issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   Fixed by pr [#19595](https://github.com/apache/shardingsphere/pull/19595)


-- 
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] peilinqian commented on issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   ```
   test_db=> create table t_broadcast(id int);
   CREATE TABLE
   test_db=> insert into t_broadcast values(1);
   INSERT 0 1
   test_db=> begin;
   BEGIN
   test_db=> select * from t_broadcast;
   ERROR:  relation "t_broadcast" does not exist on dn_6001
   LINE 1: select * from t_broadcast;
                         ^
   test_db=> end;
   ROLLBACK
   test_db=> select * from t_broadcast;
    id
   ----
     1
   (1 row)
   
   test_db=>
   ```
   
   
   ```
   test_db=> begin;
   BEGIN
   test_db=> select * from t_ssdb;
   ERROR:  relation "t_ssdb" does not exist on dn_6001
   LINE 1: select * from t_ssdb;
                         ^
   test_db=> end;
   ROLLBACK
   test_db=> select * from t_ssdb;
    id | c_id | a  |     b
   ----+------+----+------------
     2 |    1 | 20 | test21
     2 |    2 | 20 | test22
     2 |    3 |    | Test22
     4 |    4 | 40 | test4
     1 |    1 | 10 | test11
     1 |    2 | 10 | Test12
     1 |    2 |    | test12
     3 |    3 |    | test3
     3 |    3 |    | test3
     5 |    5 | 50 | Test5
   (10 rows)
   
   test_db=>
   ```
   


-- 
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] strongduanmu commented on issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   This bug has been fixed, so I will close this issue.


-- 
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] strongduanmu closed issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist
URL: https://github.com/apache/shardingsphere/issues/19825


-- 
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] FlyingZC commented on issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   It's been too long, I don't know which pr fixed this issue, and now my test result is correct. @peilinqian 


-- 
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] FlyingZC commented on issue #19825: In the XA-Narayana transaction type scenario, when start a transaction and select one table, it prompts that the table does not exist

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

   I want to investigate this issue. @strongduanmu 


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