peilinqian opened a new issue, #19447:
URL: https://github.com/apache/shardingsphere/issues/19447
## Feature Request
**For English only**, other languages will not accept.
Please pay attention on issues you submitted, because we maybe need more
details.
If no response anymore and we cannot make decision by current information,
we will **close it**.
Please answer these questions before submitting your issue. Thanks!
### Is your feature request related to a problem?
When a transaction is in traffic routing ,at the same time traffic rules is
modified by distsql,There is a possibility that the failure occurs.
for example:
transaction :
@Test
public void testTraffic_24_01() throws SQLException,
InterruptedException {
String sql1 = "update t_order SET content='test11' where
user_id=11;";
String sql2 = "INSERT INTO t_order(user_id, content,
creation_date) VALUES(11, 'test11', current_date);";
String sql3 = "delete from t_order where user_id=11;";
for (int i = 0; i < 1000; i++) {
setAutoCommit(false);
System.out.println("transaction:" + i + "start");
getStatement().executeUpdate(sql1);
getStatement().executeUpdate(sql2);
getStatement().executeUpdate(sql3);
TimeUnit.SECONDS.sleep(2);
commit();
System.out.println("transaction:" + i + "end");
}
}
distsql:
drop traffic rule transaction_traffic;
create traffic rule transaction_traffic(labels(sharding1),
traffic_algorithm(type(name=Proxy)),
load_balancer(type(name=ROUND_ROBIN)));
--Repeat alter tranffic rule
alter traffic rule transaction_traffic(labels(sharding2),
traffic_algorithm(type(name=Proxy)),
load_balancer(type(name=ROUND_ROBIN)));
show traffic rules;
### Describe the feature you would like.
--
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:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]