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

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Problem Summary: The `SHOW TRASH` command only displays aggregated 
`TrashUsedCapacity` per backend, providing very limited information for 
troubleshooting disk space issues. Users cannot see per-disk trash details, 
trash file counts, or disk capacity/availability. Additionally, `SHOW TRASH ON` 
has a parser bug where the backend parameter is silently discarded.
   
   **Changes:**
   
   1. **Thrift**: Added `trash_file_num`, `disk_capacity`, `available_capacity` 
as optional fields to `TDiskTrashInfo`
   2. **BE**: 
      - Added `trash_file_num` to `DataDirInfo`; `DataDir` counts trash 
subdirectories in `update_trash_capacity()`
      - `BackendService::get_disk_trash_used_capacity()` now populates the 
three new fields
   3. **FE**: 
      - `TrashProcDir` now calls `getDiskTrashUsedCapacity()` instead of 
`getTrashUsedCapacity()`, expanding from 3 columns to 8 columns: `BackendId | 
Backend | RootPath | State | TrashUsedCapacity | TrashFileNum | DiskCapacity | 
AvailableCapacity`
      - `TrashProcNode` adapted for 6 columns per disk
      - `ShowTrashCommand` column width adjusted from `varchar(30)` to 
`varchar(60)`
   4. **Bug fix**: Fixed `LogicalPlanBuilder.visitShowTrash()` where `SHOW 
TRASH ON` backend parameter was silently discarded
   
   **Before:**
   ```
   +----------+-----------+------------------+
   | BackendId | Backend   | TrashUsedCapacity |
   +----------+-----------+------------------+
   | 10001    | 10.0.0.1  | 1024             |
   +----------+-----------+------------------+
   ```
   
   **After:**
   ```
   
+----------+-----------+----------+-------+------------------+-------------+--------------+--------------------+
   | BackendId | Backend   | RootPath | State | TrashUsedCapacity | 
TrashFileNum | DiskCapacity | AvailableCapacity  |
   
+----------+-----------+----------+-------+------------------+-------------+--------------+--------------------+
   | 10001    | 10.0.0.1  | /data1   | OK    | 512              | 3           | 
107374182400 | 53687091200        |
   | 10001    | 10.0.0.1  | /data2   | OK    | 512              | 2           | 
107374182400 | 53687091200        |
   
+----------+-----------+----------+-------+------------------+-------------+--------------+--------------------+
   ```
   
   ### Release note
   
   SHOW TRASH now displays per-disk details including RootPath, State, 
TrashFileNum, DiskCapacity, and AvailableCapacity. Fixed SHOW TRASH ON parser 
bug.
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [ ] Unit Test
       - [ ] Manual test
       - [ ] No need to test or manual test. Explain why:
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. SHOW TRASH output changes from 3 columns (BackendId, Backend, 
TrashUsedCapacity) to 8 columns (BackendId, Backend, RootPath, State, 
TrashUsedCapacity, TrashFileNum, DiskCapacity, AvailableCapacity)
   
   - Does this need documentation?
       - [ ] No.
       - [x] Yes. <!-- Will submit doc PR separately -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label


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