Skip to content

branch-4.0: [fix](compaction) Keep cumulative inputs mergeable after score trimming #65470 - #67602

Open
Yukang-Lian wants to merge 1 commit into
apache:branch-4.0from
Yukang-Lian:codex/pick-65470-doris-4.0-20260907
Open

branch-4.0: [fix](compaction) Keep cumulative inputs mergeable after score trimming #65470#67602
Yukang-Lian wants to merge 1 commit into
apache:branch-4.0from
Yukang-Lian:codex/pick-65470-doris-4.0-20260907

Conversation

@Yukang-Lian

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: None

Related PR: #65470, #59268

Problem Summary: Backport #65470 to branch-4.0. Max-score tail trimming can otherwise leave a single non-overlapping cumulative rowset, which cannot be compacted alone and repeatedly returns no suitable version.

The cloud and local policies remember the last trimmed rowset and restore that direct successor when trimming would strand a non-overlapping singleton. A one-off max-score overshoot is accepted so the input remains mergeable. The test-context conflict was resolved against this branch's olap layout by retaining existing branch tests and adding only #65470's focused regression cases.

Source commit: 54300f922fddbeac6e679a83d7829444d4a72f77. The branch is based on the latest branch-4.0 at publication time.

Release note

Prevent max-score trimming from leaving an unmergeable cumulative-compaction input on branch-4.0.

Check List (For Author)

  • Test: Focused cloud and local regression coverage backported
    • Clang Format 16 changed-line check: passed
    • git diff --check: passed
    • Full branch-specific BE unit tests were not run locally; hosted CI is requested below
  • Behavior changed: Yes
    • Restores the direct successor when trimming strands a non-overlapping singleton
  • Does this need documentation: No

…ng (apache#65470)

Issue Number: None

Related PR: apache#59268

Problem Summary:

When the cumulative compaction max score is reduced, back trimming can
leave a single non-overlapping rowset. It cannot be compacted alone, so
compaction repeatedly returns `CUMULATIVE_NO_SUITABLE_VERSION` without
advancing the cumulative point.

This change remembers the last trimmed rowset in both cloud and local
size-based policies. If trimming strands a single non-overlapping
rowset, it restores the direct successor and allows one max-score
overshoot so the input remains mergeable. Existing overlapping-singleton
and cloud empty-rowset behavior is unchanged.

Prevent max-score trimming from leaving an unmergeable cumulative
compaction input.

(cherry picked from commit 54300f9)
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Yukang-Lian

Copy link
Copy Markdown
Collaborator Author

run buildall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants