Yukang-Lian opened a new pull request, #62596:
URL: https://github.com/apache/doris/pull/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).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to