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/07/18 02:04:35 UTC

[GitHub] [shardingsphere] peilinqian opened a new issue, #19304: The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on one proxy, without load balancing

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

   ## 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: 7c67365b394d2e3ac562329b550c135c31ea764d
   Commit Message: Avoid overhead of invoking method in Optional.orElse (#18921)
   Branch: 7c67365b394d2e3ac562329b550c135c31ea764d
   Build time: 2022-07-08T19:24:17+0800
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on different proxies, with load balancing
   ### Actual behavior
   The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on one proxy, without load balancing
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1、proxy label configuration
   ss-proxy1 label:sharding1
   ss-proxy2 label:sharding2
   
   2、Configure transaction routing rules as proxy
   drop traffic rule transaction_traffic;
   create traffic rule transaction_traffic(labels(sharding1,sharding2),
   traffic_algorithm(type(name=Proxy)),
   load_balancer(type(name=ROUND_ROBIN)));
   show traffic rules;
   
   3、execute ss-jdbc
   	@Test
   	public void testTraffic_15_01() throws SQLException {
   		String sql1 = "INSERT INTO t_order(user_id, content, creation_date) VALUES(11, 'test11', current_date);";
   		String sql2 = "update  t_order SET  content='test11' where  user_id=11;";
   		String sql3 = "delete from t_order where user_id=11;";
   		setAutoCommit(false);
   		for (int i = 0; i < 50; i++) {
   			getStatement().executeUpdate(sql1);
   			getStatement().executeUpdate(sql2);
   			getStatement().executeUpdate(sql3);
   		}
   		commit();
   	}
   
   
   ### 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] strongduanmu commented on issue #19304: The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on one proxy, without load balancing

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

   I tested the following code and it load balances correctly.
   
   ```java
   String sql1 = "INSERT INTO t_order(user_id, content, creation_date) VALUES(11, 'test11', current_date);";
   String sql2 = "update t_order SET content='test11' where user_id=11;";
   String sql3 = "delete from t_order where user_id=11;";
   Statement statement = getStatement();
   setAutoCommit(false);
   for (int i = 0; i < 50; i++) {
       statement.executeUpdate(sql1);
       statement.executeUpdate(sql2);
       statement.executeUpdate(sql3);    
   }
   commit();
   sql1 ="INSERT INTO t_order(user_id, content, creation_date) VALUES(22, 'test22', current_date);";
   sql2 = "update t_order SET content='test22' where user_id=22;";
   sql3 = "delete from t_order where user_id=22;";
   setAutoCommit(false);
   for (int i = 0; i < 50; i++) {
       statement.executeUpdate(sql1);
       statement.executeUpdate(sql2);
       statement.executeUpdate(sql3);
   }
   commit();
   ```


-- 
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 #19304: The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on one proxy, without load balancing

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

   @peilinqian Thank you for your feedback, I will investigate 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 #19304: The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on one proxy, without load balancing

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #19304:  The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on one proxy, without load balancing
URL: https://github.com/apache/shardingsphere/issues/19304


-- 
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 #19304: The transaction routing policy is configured as proxy, the label is configured with multiple proxies, and multiple transactions are executed, all executed on one proxy, without load balancing

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

   Currently, ShardingSphere only supports load balancing for multiple SQL executions in the same Statement. Different Statements maintain different load balancing counters.


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