mirror of
https://github.com/apache/doris.git
synced 2026-11-04 18:29:59 +00:00
## 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).
19 lines
192 B
Plaintext
19 lines
192 B
Plaintext
-- This file is automatically generated. You should know what you did if you want to edit this
|
|
-- !select_count --
|
|
12
|
|
|
|
-- !select_all --
|
|
1 1
|
|
2 2
|
|
3 3
|
|
4 4
|
|
5 5
|
|
6 6
|
|
7 7
|
|
8 8
|
|
9 9
|
|
10 10
|
|
11 11
|
|
12 12
|
|
|