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
ALTER TABLE t TRUNCATE PARTITION will block inserts to the truncated partition during both "delete only" and "delete reorganization" regardless if there is a duplicate key or not.
How to test:
-- client 1createtablet (a intprimary key nonclustered global, b int) partition by hash (b) partitions 3;
insert into t values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
-- client 2begin;
selectcount(*) from t;
-- client 1altertable t truncate partition p0;
-- client 3begin;
insert into t values (9,9); -- fails with "ERROR 8210 (HY000): the partition is in not in public"select*frominformation_schema.DDL_JOBSwhere table_name ='t'order by job_id desclimit1; -- shows "delete only" schema state-- client 2rollback;
begin;
insert into t values (12,12); -- fails with "ERROR 8210 (HY000): the partition is in not in public"select*frominformation_schema.DDL_JOBSwhere table_name ='t'order by job_id desclimit1; -- shows "delete only" schema state-- client 3rollback;
begin;
insert into t values (15,15); -- fails with "ERROR 8210 (HY000): the partition is in not in public"select*frominformation_schema.DDL_JOBSwhere table_name ='t'order by job_id desclimit1; -- shows "delete reorganization" schema state-- client 2rollback;
begin;
insert into t values (18,18);
select*frominformation_schema.DDL_JOBSwhere table_name ='t'order by job_id desclimit1; -- shows "delete reorganization" schema state-- client 3rollback;
begin;
insert into t values (21,21); -- Finally succeeds!select*frominformation_schema.DDL_JOBSwhere table_name ='t'order by job_id desclimit1; -- shows "none" schema state, done state-- client 2insert into t values (24,24); -- Still fails with "ERROR 8210 (HY000): the partition is in not in public"select*frominformation_schema.DDL_JOBSwhere table_name ='t'order by job_id desclimit1; -- shows "none" schema state, done staterollback; -- now client 1 will finish and the job will be syncedinsert into t values (27,27); -- Finally succeeds!select*frominformation_schema.DDL_JOBSwhere table_name ='t'order by job_id desclimit1; -- shows "none" schema state, synced state
I would expect that during "delete reorganize" state, which can take a long time if the partition was big, that inserts/updates/deletes would work without errors (not even duplicate key errors).
During the first schema state "delete only" I would accept that "duplicate key" errors were given.
The text was updated successfully, but these errors were encountered:
Enhancement
ALTER TABLE t TRUNCATE PARTITION will block inserts to the truncated partition during both "delete only" and "delete reorganization" regardless if there is a duplicate key or not.
How to test:
I would expect that during "delete reorganize" state, which can take a long time if the partition was big, that inserts/updates/deletes would work without errors (not even duplicate key errors).
During the first schema state "delete only" I would accept that "duplicate key" errors were given.
The text was updated successfully, but these errors were encountered: