Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After the master-slave switch, the 8066 side opens the transaction for rollback and some data is not rolled back #3747

Closed
wenyh1 opened this issue Jun 16, 2023 · 0 comments · Fixed by #3681, #3693, #3687 or #3699
Assignees
Labels
Milestone

Comments

@wenyh1
Copy link
Member

wenyh1 commented Jun 16, 2023

dble版本:3.22.01.3
复现步骤&现象:
1、db.xml中准备一个dbGroupAinstanceM(主实例),instanceS(从实例), splitMode设置为0,启动dble
2、在9066-1窗口中执行 dbGroup @@switch name = 'dbGroupA' master='instanceS';
3、在8066-1窗口中执行:set autocommit = 0; insert into values singleTable1(1);
4、在9066-1窗口中执行 show @@session; 可以看到 8066-1 用到的后端连接bcon1
5、加入 Btrace2213.java 桩,在8066-1窗口中执行 insert into values singleTable1(2); 当打印'into zhuang...',此时去dble日志中能检索到有‘release slave connection,can't be used in trasaction .....’BackendConnection ... 对应后端连接是bcon1;
6、在桩hang期间(默认hang60s), 创建8066-2 执行 set autocommit = 0; insert into values singleTable1(3); 此时去9066-1中执行show @@session;结果中的bcon1被8066-2连接使用了、而8006-1没有后端连接。
7、桩hang结束后打印‘end zhuang...’, 此时去8066-1中select * from singleTable1;结果中查不到1数据,进行rollback后,再此查询结果为空。
8、在8066-2中执行commit; 后查询singleTable1表结果1、3
9、在8066-1中set autocommit =1后 查询singleTable1表结果1、3

实际现象:看起来数据1没有被8066-1 执行的rollback 回滚掉

(预期)理论上:
第5步,不会有‘release slave connection,can't be used in trasaction...' 日志打印
第6步,9066-1中执行show @@session; bcon1还是被8066-1使用的
第7步,第一次查询结果为1、2,rollback后,再查询为null
第8步,8066-2 commit前后,都只能查询到3
第9步,8066-1 执行 set autocommit =1后 也只能查询到3

@wenyh1 wenyh1 added this to the 3.23.04.0 milestone Jun 16, 2023
@wenyh1 wenyh1 self-assigned this Jun 16, 2023
@wenyh1 wenyh1 added the bug label Jun 16, 2023
@wenyh1 wenyh1 changed the title 主从切换后,业务端开启事务,进行rollback,出现部分数据没有被回滚 After the master-slave switch, the 8066 side opens the transaction for rollback and some data is not rolled back Jun 16, 2023
@wenyh1 wenyh1 closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment