Skip to content

branch-4.1: [feat](compaction) Support ADMIN COMPACT TABLE type='FULL' and enable it in cloud mode #62596#62675

Closed
github-actions[bot] wants to merge 1 commit intobranch-4.1from
auto-pick-62596-branch-4.1
Closed

branch-4.1: [feat](compaction) Support ADMIN COMPACT TABLE type='FULL' and enable it in cloud mode #62596#62675
github-actions[bot] wants to merge 1 commit intobranch-4.1from
auto-pick-62596-branch-4.1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Cherry-picked from #62596

… it in cloud mode (#62596)

## Summary

Unify the ``ADMIN COMPACT TABLE ... WHERE type = '...'`` SQL entry so
that BASE, CUMULATIVE and FULL all work on both the local and cloud
(storage-compute split) engines. Before this change, FULL was rejected
in FE and cloud mode was blocked outright, forcing users to curl each
BE's HTTP API to run manual compaction.

## What changes

### FE

- ``AdminCompactTableCommand``: add ``FULL`` to ``CompactionType``,
relax ``analyzeWhere``, map ``FULL -> \"full\"`` in
``getCompactionType``, and drop the cloud-mode gate so the command
dispatches via the normal Agent RPC path.
- ``CloudEnv.compactTable``: override ``Env.compactTable`` to walk
partitions/indices/tablets, resolve the primary BE via
``Replica.getBackendId()``, skip tablets whose compute group has no
available BE, and raise ``DdlException`` if nothing was dispatched.

### BE

- ``submit_table_compaction_callback``: strictly match
``base``/``cumulative``/``full`` instead of silently downgrading any
non-``\"base\"`` value to ``CUMULATIVE_COMPACTION``. FULL goes through
``submit_compaction_task(force=false, eager=true,
trigger_method=MANUAL)`` after setting
``last_full_compaction_schedule_time``, matching the HTTP API default.
- ``cloud_submit_table_compaction_callback``: new callback mirroring the
local one but calling ``CloudStorageEngine::submit_compaction_task``;
honors the cloud HTTP convention that base/cumu need
``sync_delete_bitmap`` while full does not.
- ``agent_server::cloud_start_workers``: register the previously
stubbed-out ``SUBMIT_TABLE_COMPACTION`` worker (drops the ``//
TODO(plat1ko)`` comment).

### Thrift / wire compatibility

``TCompactionReq.type`` remains ``optional string``, so no IDL change. A
new FE against an old BE would see ``\"full\"`` silently downgraded
(local) or dropped (cloud), so the release order is **all BEs upgraded
first, then FE**. FE rollback can lead BE since the FE simply stops
sending ``\"full\"``.

## Test plan

- [x] ``mvn -pl fe-core -am compile`` passes.
- [x] New regression suite
``regression-test/suites/compaction/test_admin_compact_table.groovy``
covers base / cumulative / full end-to-end on the local engine, plus
negative cases (unknown type, missing WHERE).
- [x] New regression suite
``regression-test/suites/cloud_p0/compaction/test_cloud_admin_compact_table.groovy``
covers the same matrix on the cloud engine.
- [x] Design document and code reviewed independently by Codex (two
rounds).
@github-actions github-actions Bot requested a review from yiguolei as a code owner April 21, 2026 08:42
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 21, 2026

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?

@dataroaring dataroaring reopened this Apr 21, 2026
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 21, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/51) 🎉
Increment coverage report
Complete coverage report

@Yukang-Lian
Copy link
Copy Markdown
Collaborator

Closed in favor of a combined cherry-pick PR that groups #61222, #61621, #61696, #62596 into a single branch-4.1 PR.

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.

4 participants