nooneuse opened a new pull request, #70934: URL: https://github.com/apache/doris/pull/70934
### Background Local storage BE uses separate workers for base and cumulative compaction, but a single producer submits both. Compaction permits are acquired before enqueue and returned on exit; queued jobs also hold permits. ### What problem does this PR solve? Issue Number: None Related PR: #63643 (fixed the submit result checked on the current master path) PR Type: Bugfix Problem Summary: Base compaction can consume the shared permit budget and block the producer before cumulative compaction can be queued. The optional isolated path reserves permits and a disk slot for cumulative work and ends the current automatic submission round on admission pressure instead of blocking the shared producer. The feature is off by default and does not split worker pools or alter merge policies. ### Details - **Change map:** Production code +348/-39 and tests +197/-0; no generated files or docs. Admission accounting and leases: +207; scheduling and task cleanup: +122/-38; configuration and engine wiring: +19/-1. - **Frequency:** Triggered when long base work holds enough permits to block a subsequent automatic submission. - **Root cause:** One producer and one blocking permit pool couple two separate worker pools. Queued tasks also hold permits, and scan-time disk counts are not hard bounds at admission. - **Why existing tests missed it:** Existing unit tests cover permit accounting and compaction submission in isolation, not automatic cumulative dispatch with a saturated base lane on the same disk. - **Fix:** Make isolated automatic admission fail fast for the rest of that round, atomically lease permits and per-disk slots, and return those resources if the queued callback is rejected, runs, or is discarded. Keep both same-round candidate skipping and starvation policy out of this initial change. - **Other paths and branches:** Local regular FULL and CHANGELOG use the non-reserved permit lane. Existing force requests bypass permits but retain disk checks when enabled. Manual HTTP direct base/cumulative and cloud are not changed. The equivalent blocking cause was observed in branch-4.0; no backport included. - **Configs and defaults:** `enable_cumulative_compaction_isolation=false` and `cumulative_compaction_reserved_permits=0`; both require a BE restart. Enabling isolation requires a positive reservation below `total_permits_for_compaction_score`; disabling it preserves legacy admission. - **Behavior change:** With the startup switch enabled, permit and disk admission, and resulting queue order and throughput, change. The default path is unchanged. ### Testing - Local: BE build hygiene, repository clang-format 16 and diff whitespace checks passed. - Isolated Linux/x86_64 ASAN build: six focused BE tests passed. The unsuppressed run passed its assertions but exited with a 352-byte libomp allocation report, which was also reproduced by running only the existing legacy limiter test. The final run suppressed only `___kmp_allocate_align`; leak detection remained enabled. - Negative control: disabling isolated admission in the scheduler fixture left the shared producer waiting and failed the cumulative worker assertion. The restored candidate passed and the modified BE files were checksum-matched to the local source. - An ASAN FE/BE build and a cluster comparison using generated data passed: while an existing debug point held base permits after its merge, cumulative completed a real merge of 20,000 rows only with isolation enabled. Both modes passed query checksum, version continuity, and permit cleanup checks. - The cluster experiment is not part of the committed CI suites; long-running mixed load and wide-table peak memory remain untested. `run-clang-tidy.sh` did not complete cleanly because of resource-header lookup and standalone-header analysis errors. ### Release note Local BE operators can opt in to cumulative compaction admission isolation with `enable_cumulative_compaction_isolation` and an absolute `cumulative_compaction_reserved_permits`. The switch is off by default; enabling or reverting it requires restarting BE. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes; add configuration and rollout instructions to the website when accepted. - Pre-submission status: Partially verified: focused ASAN unit tests, the formal FE/BE build, and the generated-data cluster comparison pass; sustained mixed-load and wide-table resource behavior remain untested, and clang-tidy did not complete cleanly. ### AI Disclosure - Tool: OpenAI coding assistant - Generated: implementation, targeted tests - Human review: reviewed -- 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]
