Ryan19929 opened a new pull request, #58897:
URL: https://github.com/apache/doris/pull/58897

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ## Background
   
   In current Doris, storage medium (SSD/HDD) selection lacks fine-grained 
control:
   1. Implicit medium selection with inconsistent fallback behavior
   2. Restore operations cannot control whether to preserve or override source 
table's storage medium
   
   ## Main Changes
   
   **FE:**
   - `DataProperty.java`: Add `MediumAllocationMode` enum
   - `RestoreCommand.java`: Support new properties
   - `RestoreJob.java`: Integrate medium decision logic
   - `MediumDecisionMaker.java`: Centralized medium selection (new)
   - `SystemInfoService.java`: Support allocation mode in backend selection
   - `TableProperty.java`: Persist `medium_allocation_mode`
   - `FrontendService.thrift`: Add new RPC fields
   
   **BE:**
   - `config.cpp/h`: Add `enable_storage_medium_fallback` for runtime fallback
   - `storage_engine.cpp`: Support fallback logic
   
   ## Usage Examples
   
   ```sql
   -- Create with strict mode
   CREATE TABLE t1 (...) PROPERTIES (
       'storage_medium' = 'ssd',
       'medium_allocation_mode' = 'strict'
   );
   
   -- Restore preserving source medium
   RESTORE SNAPSHOT db1.snap FROM repo PROPERTIES (
       'backup_timestamp' = '...',
       'storage_medium' = 'same_with_upstream',
       'medium_allocation_mode' = 'adaptive'
   );
   ```
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


-- 
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