Skip to content

branch-4.1: [improvement](compaction) split time series compaction score metric #63900 - #67607

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

branch-4.1: [improvement](compaction) split time series compaction score metric #63900#67607
Yukang-Lian wants to merge 1 commit into
apache:branch-4.1from
Yukang-Lian:codex/pick-63900-doris-4.1-20260907

Conversation

@Yukang-Lian

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: None

Related PR: #63900

Problem Summary: Backport the compaction score metric split from #63900 to branch-4.1.

The change keeps the existing cumulative score as the aggregate maximum and adds separate size-based and time-series policy gauges for both local and Cloud BEs. Score collection remains independent from whether a tablet is selected for execution. Complete checks may clear a missing policy to zero, while incomplete local scans caused by capacity-limited disks do not lower the gauges.

The backport preserves this branch's std::vector<TabletSharedPtr> scheduling API and its existing compaction eligibility behavior. This release branch has no cumulative-binlog compaction score path, so the master-only binlog clauses and tests are intentionally omitted.

The branch is rebased onto the latest branch-4.1.

Release note

Add separate size-based and time-series cumulative compaction score metrics while preserving the aggregate metric.

Check List (For Author)

  • Test: Unit Test
    • Added or updated 13 focused metric, local scheduling, and Cloud scheduling regression cases
    • clang-format 16 --dry-run --Werror: passed for all changed C++ files
    • git diff --check: passed
    • Exact-base linked BE tests were not run locally; hosted CI is requested with run buildall
  • Behavior changed: Yes
    • Adds two observable per-policy compaction score gauges
    • Preserves tablet ranking, selection, and the existing aggregate score semantics
  • Does this need documentation: No

…pache#63900)

### What problem does this PR solve?

Before this change, BE exposes only the aggregate cumulative compaction
score:

```bash
curl -s http://<be_host>:<webserver_port>/metrics \
  | grep 'doris_be_tablet_cumulative_max_compaction_score'
```

The aggregate value cannot show which cumulative compaction policy
contributes the maximum score.

After this change, observe the aggregate and per-policy scores with:

```bash
curl -s http://<be_host>:<webserver_port>/metrics \
  | grep -E 'doris_be_tablet_(cumulative|size_based|time_series)_max_compaction_score'
```

| Metric | Meaning |
| --- | --- |
| `doris_be_tablet_cumulative_max_compaction_score` | Maximum score
across all cumulative compaction policies; semantics unchanged |
| `doris_be_tablet_size_based_max_compaction_score` | Maximum score from
the size-based policy |
| `doris_be_tablet_time_series_max_compaction_score` | Maximum score
from the time-series policy |

New behavior:

- Local and Cloud BEs publish the two per-policy metrics.
- The existing aggregate metric and BE report value `max(base,
cumulative)` remain unchanged.
- Compaction score calculation, tablet ranking, and tablet selection are
unchanged.
- A complete score check can reset a missing policy score to zero; an
incomplete local scan caused by capacity-limited disks does not lower
the cumulative score metrics.

### Release note

Add separate size-based and time-series cumulative compaction score
metrics while preserving the existing aggregate metric.
@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