Repository navigation
branch-4.2: [fix](fe) Check automatic partition limit before creation - #69502
Merged
Merged
Conversation
### What problem does this PR solve? Issue Number: None Related PR: apache#69128 Problem Summary: Automatic partition creation checked max_auto_partition_num only after adding all requested partitions, so a rejected load could leave newly created partitions behind. Count missing partition names under the table read lock before the batch, and recheck capacity under the table write lock just before publishing each automatic partition. Existing-name requests at the limit remain valid; explicit partition DDL keeps its previous behavior. Under concurrent exhaustion, earlier within-limit partitions in a batch may remain. Cherry-picked from apache#69128 onto branch-4.2. Resolve conflicts by retaining branch-4.2's AddPartitionClause API and JUnit 4 test conventions. The master-only adjacent row-binlog test is not included. ### Release note Automatic partition requests exceeding max_auto_partition_num are rejected before creating partitions in the normal batch path. ### Check List (For Author) - Test: FE build and Checkstyle; focused FE unit tests for range overflow, existing LIST partitions, and stale-precheck publication; git diff --check. - Behavior changed: Yes. Over-limit automatic partition requests no longer leave newly created partitions in the normal batch path. - Does this need documentation: No. (cherry picked from commit 33c460d)
Member
Author
|
run buildall |
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
FE Regression Coverage ReportIncrement line coverage |
mrhhsg
marked this pull request as ready for review
October 23, 2026 09:22
yiguolei
approved these changes
Oct 23, 2026
yiguolei
approved these changes
Oct 23, 2026
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
|
PR approved by at least one committer and no changes requested. |
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.
Summary
Cherry-picked from #69128 for branch-4.2.
Automatic partition creation previously checked
max_auto_partition_numonly after creating partitions, so an over-limit request could fail after leaving new partitions behind. This change counts only missing partition names under the table read lock and rejects an over-limit batch before creation. It also rechecks capacity under the table write lock before publishing each automatic partition, while preserving the existing behavior of explicit partition DDL.Backport notes
The branch-4.2 implementation uses its existing
AddPartitionClauseAPI and JUnit 4 test conventions. If concurrent requests exhaust capacity during a batch, partitions already published within the limit can remain.Tests
./build.sh --fe(passed; FE Checkstyle: 0 violations)../run-fe-ut.sh --run 'org.apache.doris.service.FrontendServiceImplTest#testCreatePartitionRangeLimitDoesNotLeavePartitions+testCreatePartitionListLimitCountsOnlyNewPartitions+testCreatePartitionLimitIsRecheckedAtPublication'(3 passed, 0 failures, 0 errors).git diff origin/branch-4.2...HEAD --check(passed).