You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Pessimistic mode:drop primary key, then commit, insert into table failed. #11213
- Version or commit-id (e.g. v0.1.0 or 8b23a93): 3194798c98fd5775a5f2b3b66457757bea9595db
- Hardware parameters:
- OS type:
- Others:
Actual Behavior
not wait for lock
Expected Behavior
No response
Steps to Reproduce
drop table if exists alter01;
create table alter01(col1 int not null ,col2 varchar(25));
insert into alter01 values (3,"a"),(4,"b"),(5,"c");
begin;
alter table alter01 modify col1 float;
-- @session:id=1{
-- @wait:0:commit
use transaction_enhance;
insert into alter01 values (8,"h");
select * from alter01;
-- @session
insert into alter01 values (6,"h");
commit;
select * from alter01;
the same problem:
drop table if exists rename01;
create table rename01 (c int primary key,d int);
insert into rename01 values(1,1);
insert into rename01 values(2,2);
begin;
insert into rename01 values(3,1);
insert into rename01 values(4,2);
alter table rename01 rename column c to newCCCC;
select * from rename01;
-- @session:id=1{
use isolation;
-- @wait:0:commit
insert into rename01 (c, d) values (5,7);
insert into rename01 (newCCCC, d) values (5,7);
select * from rename01;
-- @session}
select * from rename01;
drop table rename01;
drop table if exists alter01;
create table alter01(col1 int primary key,col2 varchar(25));
insert into alter01 values (3,"a"),(4,"b"),(5,"c");
begin;
alter table alter01 drop primary key;
-- @session:id=1{
-- @wait:0:commit
use transaction_enhance;
insert into alter01 values (5,"h");
select * from alter01;
-- @session
insert into alter01 values (6,"h");
select * from alter01;
drop table alter01;
Actual behavior:
Expect behavior:
session 1: alter table drop primary key, session 2: insert into alter01 values (5,"h"), session1: commit, session2: insert into alter01 values (5,"h") execute success!
changed the title [-][Bug]: Pessimistic mode:alter table does not wait for lock in alter table modify column sql.[/-][+][Bug]: Pessimistic mode:drop primary key, then commit, insert into table failed.[/+]on Sep 14, 2023
Activity
ouyuanning commentedon Aug 15, 2023
not working on it
ouyuanning commentedon Aug 16, 2023
same as #11217
Ariznawlll commentedon Aug 17, 2023
the same problem:
drop table if exists rename01;
create table rename01 (c int primary key,d int);
insert into rename01 values(1,1);
insert into rename01 values(2,2);
begin;
insert into rename01 values(3,1);
insert into rename01 values(4,2);
alter table rename01 rename column c to
newCCCC;select * from rename01;
-- @session:id=1{
use isolation;
-- @wait:0:commit
insert into rename01 (c, d) values (5,7);
insert into rename01 (newCCCC, d) values (5,7);
select * from rename01;
-- @session}
select * from rename01;
drop table rename01;
qingxinhome commentedon Aug 23, 2023
Processing
qingxinhome commentedon Aug 24, 2023
Currently, in MO, if a table does not have a primary key defined, it is not locked in real transactions @Ariznawlll @domingozhang @ouyuanning
3 remaining items
ouyuanning commentedon Sep 3, 2023
not working on it
ouyuanning commentedon Sep 5, 2023
same as #11217
ouyuanning commentedon Sep 8, 2023
待11217合并。应该是同样的问题
ouyuanning commentedon Sep 12, 2023
待11217合并再检查看看
Ariznawlll commentedon Sep 14, 2023
drop table if exists alter01;
create table alter01(col1 int primary key,col2 varchar(25));
insert into alter01 values (3,"a"),(4,"b"),(5,"c");
begin;
alter table alter01 drop primary key;
-- @session:id=1{
-- @wait:0:commit
use transaction_enhance;
insert into alter01 values (5,"h");
select * from alter01;
-- @session
insert into alter01 values (6,"h");
select * from alter01;
drop table alter01;
Actual behavior:

Expect behavior:
session 1: alter table drop primary key, session 2: insert into alter01 values (5,"h"), session1: commit, session2: insert into alter01 values (5,"h") execute success!
[-][Bug]: Pessimistic mode:alter table does not wait for lock in alter table modify column sql.[/-][+][Bug]: Pessimistic mode:drop primary key, then commit, insert into table failed.[/+]ouyuanning commentedon Sep 15, 2023
session 2等到session 1 free lock之后。并没有执行retry,因为去重的错误覆盖掉 retry 的错误了。于是没有进入retry流程。
下周修
ouyuanning commentedon Sep 19, 2023
还没时间看
jensenojs commentedon Oct 7, 2023
相关pr已合入
Ariznawlll commentedon Oct 8, 2023
verified!