branch-3.1: [bug](group commit) Fix group commit blocked after schema change throw exception #54113#54309
Merged
morrySnow merged 1 commit intoapache:branch-3.1from Aug 5, 2025
Merged
Conversation
…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 -->
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
TPC-H: Total hot run time: 32778 ms |
TPC-DS: Total hot run time: 196896 ms |
ClickBench: Total hot run time: 29.34 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
morrySnow
approved these changes
Aug 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pick #54113