xy720 opened a new pull request, #54309:
URL: https://github.com/apache/doris/pull/54309
…w exception
Fix group commit blocked after schema change throw exception
pick #54113
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:
https://github.com/apache/doris-website/pull/1214 -->
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### 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:
https://github.com/apache/doris-website/pull/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 -->
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]