mrhhsg opened a new pull request, #69128:
URL: https://github.com/apache/doris/pull/69128
### What problem does this PR solve?
Issue Number: None
Automatic partition creation currently checks `max_auto_partition_num` only
after creating and logging every requested partition. If a load brings more
distinct partition values than the remaining capacity, the RPC fails but the
new partitions remain; repeated bad input can keep growing table metadata
beyond the configured limit.
This change counts only missing partition names before starting the batch
and rejects an over-limit request without creating any partitions. It also
checks the count under the table write lock immediately before publication, so
concurrent requests cannot publish an automatic partition beyond the
then-current limit. Existing-name requests at the limit remain valid, and
explicit partition DDL keeps its prior behavior.
A concurrent request can exhaust the remaining capacity partway through
another multi-partition batch. In that case, partitions already published
within the limit are not rolled back; the change enforces the publication cap,
not atomicity of the whole batch. It does not remove existing oversized tables
or change the image serialization format.
### 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 Unit Test:
`FrontendServiceImplTest#testCreatePartitionRangeLimitDoesNotLeavePartitions+testCreatePartitionListLimitCountsOnlyNewPartitions+testCreatePartitionLimitIsRecheckedAtPublication`
(3 passed)
- FE build: `DORIS_THIRDPARTY=<compatible installed snapshot> ./build.sh
--fe` (passed; fe-core Checkstyle 0 violations)
- SQL regression and real multi-threaded load test: not run; the targeted
FE RPC tests cover the limit and deterministic stale-precheck boundary.
- Behavior changed: Yes. Over-limit automatic partition requests no longer
leave new partitions in the ordinary batch path.
- Does this need documentation: No.
--
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]