branch-4.1: pick some group commit prs#61487
Conversation
…mit_data_bytes to 0 (apache#61034)
…61242) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: 1. Create table support set `group_commit_mode` table property ``` CREATE TABLE ... PROPERTIES( "group_commit_mode" = "async_mode" ); ``` 2. Support alter this property ``` ALTER TABLE ... SET ("group_commit_mode" = "off_mode"); ``` 3. Show create table shows this property if its value is not `off_mode` 4. For stream load, if it not set `group_commit` header, use the table property as the group commit mode; if it set `group_commit` header, use the header value. 5. doc: apache/doris-website#3465 ### 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: 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 -->
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new OLAP table property group_commit_mode (off/async/sync) and wires it through FE/BE so stream load can default to the table’s configured mode when the HTTP group_commit header is not provided.
Changes:
- Add
group_commit_modetable property with validation, persistence/show-create behavior, and (cloud) partition meta propagation. - Extend FE/BE stream load handshake to optionally fetch table
group_commit_modeduringloadTxnBeginwhen the client didn’t specify a mode header. - Add/adjust regression tests and golden outputs to cover the new property and validation rules.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| regression-test/suites/load_p0/stream_load/test_group_commit_stream_load.groovy | Adds stream load tests for table-property-based group commit and header override behavior. |
| regression-test/suites/insert_p0/insert_group_commit_into.groovy | Adds DDL validation tests for group commit interval/bytes and new group_commit_mode property + SHOW CREATE TABLE behavior. |
| regression-test/data/query_p0/system/test_table_properties.out | Updates expected table properties output to include group_commit_mode. |
| gensrc/thrift/FrontendService.thrift | Adds thrift fields to request/response for “use table group_commit_mode” handshake. |
| gensrc/proto/cloud.proto | Adds group_commit_mode to tablet meta update payload for cloud mode. |
| fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java | Implements early return of table group_commit_mode in loadTxnBegin when requested. |
| fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/ModifyTablePropertiesOp.java | Centralizes validation via PropertyAnalyzer and adds validation for group_commit_mode. |
| fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java | Parses/applies group_commit_mode during OLAP table creation. |
| fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java | Adds group_commit_mode constants + parsing/validation; tightens interval/bytes validation to > 0. |
| fe/fe-core/src/main/java/org/apache/doris/cloud/alter/CloudSchemaChangeHandler.java | Allows and propagates group_commit_mode updates to cloud tablet meta. |
| fe/fe-core/src/main/java/org/apache/doris/catalog/TableProperty.java | Stores/returns group_commit_mode with default off_mode. |
| fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java | Exposes get/setGroupCommitMode() through OlapTable. |
| fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java | Prints group_commit_mode in SHOW CREATE TABLE only when not off_mode. |
| fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java | Permits group_commit_mode in allowed alter-table properties. |
| be/src/runtime/stream_load/stream_load_executor.cpp | Requests table mode during begin-txn when client didn’t set a mode; adopts mode without starting txn. |
| be/src/runtime/stream_load/stream_load_context.h | Adds group_commit_mode to stream load context. |
| be/src/runtime/stream_load/stream_load_context.cpp | Adds GroupCommitMode (and LoadId) to stream load JSON response when group commit is used. |
| be/src/http/action/stream_load.h | Adds helpers for group commit eligibility and WAL-space checks. |
| be/src/http/action/stream_load.cpp | Refactors group commit mode handling to support “table property default” and centralizes WAL-space checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| set 'column_separator', ',' | ||
| // NOT setting 'group_commit' header - should use table property, but set partitions | ||
| set 'partitions', "${tableNameAsync}" | ||
| set 'columns', 'id, name' | ||
| file "test_stream_load1.csv" |
| // Check data is loaded | ||
| def rowCount2 = sql "select count(*) from ${tableNameSync}" | ||
| logger.info("Row count for sync table: " + rowCount2) | ||
| assertTrue(rowCount2[0][0] > 0, "Data should be loaded") |
|
|
||
| def createStmt2 = sql """ SHOW CREATE TABLE ${table}_mode """ | ||
| logger.info("SHOW CREATE TABLE result after alter: " + createStmt2) | ||
| assertTrue(createStmt2.toString().contains('SYNC_MODE'), "SHOW CREATE TABLE should contain sync_mode after alter") |
|
run feut |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
pick:
#61034
#61242