[fix](compaction) Keep cumulative compaction input mergeable when max-score trim strands a single non-overlapping rowset#65470
Draft
Yukang-Lian wants to merge 2 commits into
Conversation
### What problem does this PR solve? Issue Number: None Related PR: apache#59268 Problem Summary: Max-score back trimming can leave one non-overlapping cumulative rowset, which callers cannot compact by itself and may repeatedly reject. Preserve mergeability by restoring the direct successor that was last removed, accepting a one-off score overshoot. Apply the same rule to cloud and local size-based policies and cover the production-shaped layout, the overlapping-singleton control case, the cloud skip-trim path, and natural cumulative-point promotion. ### Release note Prevent cumulative compaction from repeatedly selecting an unmergeable single non-overlapping rowset after max-score trimming. ### Check List (For Author) - Test: Unit Test - sh run-be-ut.sh --run --filter='*CumulativeCompaction*' - Behavior changed: Yes, max-score trimming restores one successor only when required to keep the selected input mergeable. - Does this need documentation: No
### What problem does this PR solve? Issue Number: None Related PR: apache#59268 Problem Summary: Cloud compaction scheduling suppresses cumulative no-suitable-version statuses, making repeated prepare failures invisible outside debug logs. Emit a rate-limited INFO log with tablet ID and status while retaining warning behavior under debug logging and preserving the existing base no-suitable-version handling. ### Release note Add rate-limited visibility for repeated cloud cumulative compaction no-suitable-version retries. ### Check List (For Author) - Test: Unit Test - sh run-be-ut.sh --run --filter='*CumulativeCompaction*' - Behavior changed: Yes, cumulative no-suitable-version submissions now emit a rate-limited INFO log. - Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
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.
What problem does this PR solve?
Issue Number: None
Related PR: #59268, #64954
Problem Summary:
Problem
Under memory pressure, cloud cumulative compaction reduces the maximum compaction score. A production-shaped MOW tablet can then contain a zero-segment, non-overlapping compaction output at the cumulative point, followed by large overlapping singleton rowsets whose individual scores exceed that reduced maximum.
The max-score back trim introduced by #59268 can remove every successor from the original selected set while retaining the non-overlapping head. The caller rejects that single rowset with
CUMULATIVE_NO_SUITABLE_VERSION. Because no merge runs, the previous memory-limit status remains in effect, the same reduced maximum is reused, and the tablet can repeatedly hit the same no-suitable-version result while new versions accumulate.The cloud scheduling loop also suppressed this status outside debug logging, which made the retry loop difficult to observe.
Root cause
The deferred max-score trim deliberately keeps at least one rowset, but it did not verify that the remaining input was mergeable. When the head was non-overlapping and its direct successor alone exceeded the remaining score budget, trimming could strand the head as an invalid single-rowset input.
Fix
skip_trimbehavior unchanged.CUMULATIVE_NO_SUITABLE_VERSIONsubmission failures, while preserving the existing debug-warning andBE_NO_SUITABLE_VERSIONbehavior.This is a follow-up to #59268 and is independent of #64954.
Testing
sh run-be-ut.sh --run --filter='*CumulativeCompaction*': 74/74 passed on the final branch.skip_trimcoverage remains green.size() > 1), then reran the same suite: 74/74 passed. The overlay was removed and is not part of this PR.build-support/clang-format.sh,build-support/check-format.sh, andgit diff --checkpassed.Release note
Prevent cumulative compaction from repeatedly selecting an unmergeable single non-overlapping rowset after max-score trimming, and add rate-limited visibility for repeated no-suitable-version retries.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)