Skip to content

[bug](group commit) Fix group commit blocked after schema change throw exception#54113

Merged
lide-reed merged 1 commit intoapache:masterfrom
xy720:fix-group-commit
Aug 4, 2025
Merged

[bug](group commit) Fix group commit blocked after schema change throw exception#54113
lide-reed merged 1 commit intoapache:masterfrom
xy720:fix-group-commit

Conversation

@xy720
Copy link
Member

@xy720 xy720 commented Jul 30, 2025

What problem does this PR solve?

Fix group commit blocked after schema change throw exception

Problem Summary:

Reproduce step:

1、create table

CREATE TABLE `test_table_uniq` (
  `company_id` varchar(32) NOT NULL,
  `date` datetime NOT NULL,
  `discount` decimal(19,10) NULL,
) ENGINE=OLAP
UNIQUE KEY(`company_id`, `date`)
DISTRIBUTED BY HASH(`company_id`) BUCKETS 8

2、group commit insert SUCCESS

SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(1, '2025-07-25', 10);

3、create rollup and wait job SUCCESS

CREATE MATERIALIZED VIEW mv_company_day
AS 
SELECT   company_id,   date
FROM test_table_uniq;

4、group commit insert SUCCESS

SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(2, '2025-07-25', 11);

5、create rollup with same name and throw exception

CREATE MATERIALIZED VIEW mv_company_day
AS 
SELECT   company_id,   date
FROM test_table_uniq;
ERROR 1105 (HY000): errCode = 2, detailMessage = Materialized view[mv_company_day] already exists

6、group commit insert FAIL

SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(3, '2025-07-25', 12);

JDBC ERROR LOG:

java.sql.BatchUpdateException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
        at com.mysql.cj.util.Util.getInstance(Util.java:167)
        at com.mysql.cj.util.Util.getInstance(Util.java:174)
        at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:755)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:426)
        at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:795)
        at DorisStressTest.main(DorisStressTest.java:78)
Caused by: java.sql.SQLException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:633)
        at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:417)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:716)

Release note

master/3.0/2.1

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@xy720
Copy link
Member Author

xy720 commented Jul 30, 2025

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 33866 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 03671cca0ec7a46e89b38047979b6d00830567a1, data reload: false

------ Round 1 ----------------------------------
q1	17616	5607	5547	5547
q2	1967	289	192	192
q3	10275	1308	674	674
q4	10222	989	490	490
q5	7533	2372	2174	2174
q6	175	161	129	129
q7	896	736	591	591
q8	9288	1393	1068	1068
q9	6786	5126	5088	5088
q10	6896	2340	1960	1960
q11	456	280	277	277
q12	332	371	220	220
q13	17779	3478	2997	2997
q14	230	241	221	221
q15	519	462	467	462
q16	421	427	378	378
q17	558	820	370	370
q18	7329	7019	6962	6962
q19	1219	979	523	523
q20	324	308	214	214
q21	3261	2976	2335	2335
q22	1022	1001	994	994
Total cold run time: 105104 ms
Total hot run time: 33866 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5742	5745	5679	5679
q2	226	303	213	213
q3	2058	2532	2214	2214
q4	1282	1708	1321	1321
q5	4079	4491	4513	4491
q6	217	180	133	133
q7	1971	1973	1801	1801
q8	2500	2505	2519	2505
q9	7216	7328	7330	7328
q10	3260	3275	3109	3109
q11	631	709	482	482
q12	702	752	720	720
q13	3408	3694	3180	3180
q14	293	321	297	297
q15	525	477	454	454
q16	464	564	519	519
q17	1220	1488	1441	1441
q18	7934	7448	7604	7448
q19	6521	814	945	814
q20	2003	2039	1834	1834
q21	4852	4270	4233	4233
q22	1037	1052	972	972
Total cold run time: 58141 ms
Total hot run time: 51188 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 171801 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 03671cca0ec7a46e89b38047979b6d00830567a1, data reload: false

============================================
query1	1012	394	416	394
query2	6506	1859	1679	1679
query3	6742	226	218	218
query4	27008	23268	23100	23100
query5	4330	631	508	508
query6	332	240	228	228
query7	4636	506	295	295
query8	279	257	212	212
query9	8570	3132	3125	3125
query10	481	345	300	300
query11	15950	15081	14925	14925
query12	181	137	126	126
query13	1655	547	414	414
query14	9943	7746	7825	7746
query15	279	192	165	165
query16	7937	624	445	445
query17	1648	799	651	651
query18	2084	445	332	332
query19	300	214	195	195
query20	155	143	130	130
query21	217	127	121	121
query22	4040	3972	3882	3882
query23	34286	34113	34251	34113
query24	8101	2395	2402	2395
query25	568	594	439	439
query26	805	290	156	156
query27	2632	489	340	340
query28	4274	2272	2274	2272
query29	699	593	472	472
query30	301	232	198	198
query31	908	789	736	736
query32	96	78	77	77
query33	548	416	389	389
query34	844	834	506	506
query35	827	813	747	747
query36	1042	1048	955	955
query37	130	108	88	88
query38	3992	4026	3927	3927
query39	1448	1424	1374	1374
query40	247	143	127	127
query41	61	60	54	54
query42	137	120	127	120
query43	501	517	461	461
query44	1397	857	871	857
query45	204	185	182	182
query46	951	1058	669	669
query47	1754	1825	1730	1730
query48	412	435	313	313
query49	679	497	415	415
query50	646	699	411	411
query51	4199	4175	4127	4127
query52	127	129	114	114
query53	258	297	208	208
query54	649	638	547	547
query55	90	87	88	87
query56	373	355	345	345
query57	1196	1206	1134	1134
query58	345	331	341	331
query59	2585	2671	2604	2604
query60	409	399	397	397
query61	145	126	124	124
query62	818	734	670	670
query63	243	216	219	216
query64	3556	1082	788	788
query65	4205	4135	4149	4135
query66	962	448	329	329
query67	query68	17519	875	854	854
query69	1173	292	285	285
query70	1514	1137	1094	1094
query71	696	316	314	314
query72	9124	2323	2160	2160
query73	3546	693	357	357
query74	8994	8943	8825	8825
query75	7426	3130	2687	2687
query76	8553	1228	789	789
query77	1168	422	351	351
query78	9850	11940	9010	9010
query79	15731	647	589	589
query80	2490	558	480	480
query81	572	267	244	244
query82	511	148	117	117
query83	433	285	271	271
query84	294	99	84	84
query85	1309	366	330	330
query86	359	336	324	324
query87	4336	4259	4151	4151
query88	5615	2194	2187	2187
query89	506	367	326	326
query90	2535	224	223	223
query91	145	149	109	109
query92	139	70	66	66
query93	6715	978	654	654
query94	1177	386	268	268
query95	425	326	319	319
query96	501	588	276	276
query97	2712	2699	2700	2699
query98	243	244	222	222
query99	1455	1401	1266	1266
Total cold run time: 310701 ms
Total hot run time: 171801 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 33.21 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 03671cca0ec7a46e89b38047979b6d00830567a1, data reload: false

query1	0.04	0.04	0.03
query2	0.07	0.03	0.04
query3	0.24	0.07	0.07
query4	1.64	0.10	0.10
query5	0.43	0.42	0.42
query6	1.17	0.68	0.67
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.56	0.48	0.48
query10	0.51	0.52	0.52
query11	0.15	0.10	0.10
query12	0.14	0.10	0.10
query13	0.66	0.67	0.63
query14	0.91	1.22	0.99
query15	0.93	0.87	0.88
query16	0.39	0.39	0.40
query17	1.07	1.05	1.05
query18	0.22	0.20	0.20
query19	2.03	1.84	1.89
query20	0.01	0.01	0.01
query21	15.37	0.86	0.56
query22	0.80	1.21	0.96
query23	14.69	1.12	0.61
query24	6.18	1.29	0.77
query25	0.50	0.20	0.10
query26	0.62	0.14	0.13
query27	0.06	0.05	0.05
query28	10.02	0.86	0.44
query29	12.55	3.83	3.30
query30	3.04	3.05	2.99
query31	2.81	0.55	0.40
query32	3.25	0.56	0.50
query33	3.00	3.14	3.18
query34	16.01	5.36	4.94
query35	4.87	4.92	4.99
query36	0.71	0.53	0.50
query37	0.10	0.07	0.07
query38	0.05	0.04	0.05
query39	0.03	0.02	0.03
query40	0.18	0.14	0.14
query41	0.08	0.03	0.03
query42	0.03	0.02	0.03
query43	0.05	0.03	0.03
Total cold run time: 106.24 s
Total hot run time: 33.21 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jul 31, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@lide-reed lide-reed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lide-reed lide-reed merged commit d335abc into apache:master Aug 4, 2025
36 of 37 checks passed
xy720 added a commit to xy720/doris that referenced this pull request Aug 5, 2025
…w exception (apache#54113)

Fix group commit blocked after schema change throw exception

Problem Summary:

Reproduce step:

1、create table

```
CREATE TABLE `test_table_uniq` (
  `company_id` varchar(32) NOT NULL,
  `date` datetime NOT NULL,
  `discount` decimal(19,10) NULL,
) ENGINE=OLAP
UNIQUE KEY(`company_id`, `date`)
DISTRIBUTED BY HASH(`company_id`) BUCKETS 8
```

2、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(1, '2025-07-25', 10);
```

3、create rollup and wait job SUCCESS

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
```

4、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(2, '2025-07-25', 11);
```

5、create rollup with same name and throw exception

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
ERROR 1105 (HY000): errCode = 2, detailMessage = Materialized view[mv_company_day] already exists
```

6、group commit insert  FAIL

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(3, '2025-07-25', 12);
```

JDBC ERROR LOG:
```
java.sql.BatchUpdateException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
        at com.mysql.cj.util.Util.getInstance(Util.java:167)
        at com.mysql.cj.util.Util.getInstance(Util.java:174)
        at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:755)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:426)
        at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:795)
        at DorisStressTest.main(DorisStressTest.java:78)
Caused by: java.sql.SQLException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:633)
        at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:417)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:716)
```

master/3.0/2.1

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
xy720 added a commit to xy720/doris that referenced this pull request Aug 5, 2025
…w exception (apache#54113)

Fix group commit blocked after schema change throw exception

Problem Summary:

Reproduce step:

1、create table

```
CREATE TABLE `test_table_uniq` (
  `company_id` varchar(32) NOT NULL,
  `date` datetime NOT NULL,
  `discount` decimal(19,10) NULL,
) ENGINE=OLAP
UNIQUE KEY(`company_id`, `date`)
DISTRIBUTED BY HASH(`company_id`) BUCKETS 8
```

2、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(1, '2025-07-25', 10);
```

3、create rollup and wait job SUCCESS

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
```

4、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(2, '2025-07-25', 11);
```

5、create rollup with same name and throw exception

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
ERROR 1105 (HY000): errCode = 2, detailMessage = Materialized view[mv_company_day] already exists
```

6、group commit insert  FAIL

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(3, '2025-07-25', 12);
```

JDBC ERROR LOG:
```
java.sql.BatchUpdateException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
        at com.mysql.cj.util.Util.getInstance(Util.java:167)
        at com.mysql.cj.util.Util.getInstance(Util.java:174)
        at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:755)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:426)
        at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:795)
        at DorisStressTest.main(DorisStressTest.java:78)
Caused by: java.sql.SQLException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:633)
        at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:417)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:716)
```

master/3.0/2.1
morrySnow pushed a commit that referenced this pull request Aug 5, 2025
dataroaring pushed a commit that referenced this pull request Aug 12, 2025
… change throw exception (#54312)

Fix group commit blocked after schema change throw exception

Problem Summary:

pick #54113

Reproduce step:

1、create table

```
CREATE TABLE `test_table_uniq` (
  `company_id` varchar(32) NOT NULL,
  `date` datetime NOT NULL,
  `discount` decimal(19,10) NULL,
) ENGINE=OLAP
UNIQUE KEY(`company_id`, `date`)
DISTRIBUTED BY HASH(`company_id`) BUCKETS 8
```

2、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(1, '2025-07-25', 10);
```

3、create rollup and wait job SUCCESS

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
```

4、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(2, '2025-07-25', 11);
```

5、create rollup with same name and throw exception

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
ERROR 1105 (HY000): errCode = 2, detailMessage = Materialized view[mv_company_day] already exists
```

6、group commit insert  FAIL

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(3, '2025-07-25', 12);
```

JDBC ERROR LOG:
```
java.sql.BatchUpdateException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
        at com.mysql.cj.util.Util.getInstance(Util.java:167)
        at com.mysql.cj.util.Util.getInstance(Util.java:174)
        at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:755)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:426)
        at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:795)
        at DorisStressTest.main(DorisStressTest.java:78)
Caused by: java.sql.SQLException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:633)
        at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:417)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:716)
```

master/3.0/2.1

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
xy720 added a commit to xy720/doris that referenced this pull request Sep 4, 2025
…w exception (apache#54113)

Fix group commit blocked after schema change throw exception

Problem Summary:

Reproduce step:

1、create table

```
CREATE TABLE `test_table_uniq` (
  `company_id` varchar(32) NOT NULL,
  `date` datetime NOT NULL,
  `discount` decimal(19,10) NULL,
) ENGINE=OLAP
UNIQUE KEY(`company_id`, `date`)
DISTRIBUTED BY HASH(`company_id`) BUCKETS 8
```

2、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(1, '2025-07-25', 10);
```

3、create rollup and wait job SUCCESS

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
```

4、group commit insert  SUCCESS

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(2, '2025-07-25', 11);
```

5、create rollup with same name and throw exception

```
CREATE MATERIALIZED VIEW mv_company_day
AS
SELECT   company_id,   date
FROM test_table_uniq;
ERROR 1105 (HY000): errCode = 2, detailMessage = Materialized view[mv_company_day] already exists
```

6、group commit insert  FAIL

```
SET group_commit = async_mode;
INSERT INTO test_table_uniq (company_id, date, discount) VALUES(3, '2025-07-25', 12);
```

JDBC ERROR LOG:
```
java.sql.BatchUpdateException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
        at com.mysql.cj.util.Util.getInstance(Util.java:167)
        at com.mysql.cj.util.Util.getInstance(Util.java:174)
        at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:755)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:426)
        at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:795)
        at DorisStressTest.main(DorisStressTest.java:78)
Caused by: java.sql.SQLException: errCode = 2, detailMessage = insert table 1753872336812 is blocked on schema change
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:633)
        at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:417)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:716)
```

master/3.0/2.1

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
yiguolei pushed a commit that referenced this pull request Sep 5, 2025
… change throw exception (#55684)

### What problem does this PR solve?

pick #54113 #55132

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

Comments