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

[GitHub] [shardingsphere] peilinqian opened a new issue, #18432: create view(Single Table,no shard configured),jdbc calls ss-proxy, probabilistic failure

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

   ## 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.2-SNAPSHOT
   Commit ID: 952c1feacb26bc03ea4ea14d9f82b0d5777732c2
   Commit Message: Update shasum arguments in Release documents (#18344)
   Branch: master
   Build time: 2022-06-13T19:07:26+0000
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   create successfully
   
   ### Actual behavior
   probabilistic failure
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   `package view;
   
   import java.sql.Connection;
   import java.sql.DriverManager;
   import java.sql.ResultSet;
   import java.sql.Statement;
   
   public class ViewTest01 {
   
   	public static void main(String[] args) throws Exception {
   		Connection connection = DriverManager.getConnection("jdbc:opengauss://7.212.123.28:11000/sharding_db",
   				"sharding", "sharding");
   		Statement stmt = null;
   		stmt = connection.createStatement();
   		int rc = stmt.executeUpdate(
   				"drop table if exists test cascade;CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10));");
   		System.out.println("createresult = " + rc);
   		int createview = stmt.executeUpdate("create view test_view as select aa,id2 from test where id>80");
   		System.out.println("insertresult = " + createview);
   		ResultSet resultSet = stmt.executeQuery("select * from test_view");
   		if (resultSet.next()) {
   			System.out.println(resultSet.getString(0) + resultSet.getString(1));
   		} else {
   			System.out.println("查询结果为空");
   		}
   		stmt.close();
   		connection.close();
   	}
   }`
   
   ### 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] tuichenchuxin commented on issue #18432: create view(Single Table,no shard configured),jdbc calls ss-proxy, probabilistic failure

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

   I found the sql drop table has `cascade`. So actually it deleted the view depends on table. But shardingSphere has not maintain the relationship with table and view. So after droping table, ShardingSphere still has the view in metadata. Then it will cause the error. We'll consider how to solve it. Before, you can use drop view directly first.


-- 
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 #18432: create view(Single Table,no shard configured),jdbc calls ss-proxy, probabilistic failure

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #18432: create view(Single Table,no shard configured),jdbc calls ss-proxy, probabilistic failure
URL: https://github.com/apache/shardingsphere/issues/18432


-- 
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] tuichenchuxin commented on issue #18432: create view(Single Table,no shard configured),jdbc calls ss-proxy, probabilistic failure

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

   I tried times, but didn't get error.
   ```
       public static void main(String[] args) throws SQLException {
           Connection connection = DriverManager.getConnection("jdbc:opengauss://127.0.0.1:3307/sharding_db",
                   "sharding", "sharding");
           Statement stmt = null;
           stmt = connection.createStatement();
           int rc = stmt.executeUpdate(
                   "drop table if exists test cascade;drop view if exists test_view;CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10));");
           System.out.println("createresult = " + rc);
           int createview = stmt.executeUpdate("create view test_view as select aa,id2 from test where id>80");
           System.out.println("insertresult = " + createview);
           ResultSet resultSet = stmt.executeQuery("select * from test_view");
           if (resultSet.next()) {
               System.out.println(resultSet.getString(0) + resultSet.getString(1));
           } else {
               System.out.println("查询结果为空");
           }
           stmt.close();
           connection.close();
       }
   ```
   ```
   [INFO ] 2022-06-20 11:22:11.349 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select version()
   [INFO ] 2022-06-20 11:22:11.349 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.349 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select version()
   [INFO ] 2022-06-20 11:22:11.380 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:11.380 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.380 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.398 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.398 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:11.398 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: primary_ds ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.403 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:11.403 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.403 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:11.410 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:11.410 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropTableStatement(containsExistClause=true)
   [INFO ] 2022-06-20 11:22:11.410 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:11.430 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:11.430 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropViewStatement()
   [INFO ] 2022-06-20 11:22:11.430 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:11.439 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:11.439 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateTableStatement(containsNotExistClause=false)
   [INFO ] 2022-06-20 11:22:11.439 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:11.510 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:11.510 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateViewStatement()
   [INFO ] 2022-06-20 11:22:11.510 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:11.583 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from test_view
   [INFO ] 2022-06-20 11:22:11.583 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.583 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: select * from test_view
   [INFO ] 2022-06-20 11:22:28.867 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select version()
   [INFO ] 2022-06-20 11:22:28.867 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:28.867 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: select version()
   [INFO ] 2022-06-20 11:22:28.902 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:28.903 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:28.903 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.923 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.923 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:28.923 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: primary_ds ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.928 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:28.928 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:28.928 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:28.934 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:28.934 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropTableStatement(containsExistClause=true)
   [INFO ] 2022-06-20 11:22:28.934 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:28.949 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:28.949 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropViewStatement()
   [INFO ] 2022-06-20 11:22:28.949 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:28.958 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:28.958 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateTableStatement(containsNotExistClause=false)
   [INFO ] 2022-06-20 11:22:28.958 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:28.972 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [cd02b6f6-8a9d-40ef-87c9-fd115b4e2b5e] Try to connect. IP: 127.0.0.1:15432
   [INFO ] 2022-06-20 11:22:28.979 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [127.0.0.1:49180/127.0.0.1:15432] Connection is established. ID: cd02b6f6-8a9d-40ef-87c9-fd115b4e2b5e
   [INFO ] 2022-06-20 11:22:28.987 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID: cd02b6f6-8a9d-40ef-87c9-fd115b4e2b5e
   [INFO ] 2022-06-20 11:22:30.533 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:30.533 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateViewStatement()
   [INFO ] 2022-06-20 11:22:30.533 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:30.546 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [68c222cc-b24a-47db-83b5-0cff090ddb42] Try to connect. IP: 127.0.0.1:15432
   [INFO ] 2022-06-20 11:22:30.553 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [127.0.0.1:49181/127.0.0.1:15432] Connection is established. ID: 68c222cc-b24a-47db-83b5-0cff090ddb42
   [INFO ] 2022-06-20 11:22:30.563 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID: 68c222cc-b24a-47db-83b5-0cff090ddb42
   [INFO ] 2022-06-20 11:22:30.627 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from test_view
   [INFO ] 2022-06-20 11:22:30.628 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:30.628 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from test_view
   
   ```


-- 
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 #18432: create view(Single Table,no shard configured),jdbc calls ss-proxy, probabilistic failure

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

   ![image](https://user-images.githubusercontent.com/97432411/177981377-9bd64cb2-f00c-408f-8255-c5a0e9bb5e64.png)


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