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

   ### What problem does this PR solve?
   
   Fix bvar leak after alter tablet job failed.
   
   How to reproduce:
   
   
   1、create table
   
   ```
   CREATE TABLE `test_tbl` (
     `uid` int NOT NULL,
     `vid` varchar(600) NOT NULL,
     `pid` varchar(100) NOT NULL,
     `create_day` date NOT NULL,
     `create_time` datetime NOT NULL
   ) ENGINE=OLAP
   UNIQUE KEY(`uid`, `vid`, `pid`, `create_day`)
   PARTITION BY RANGE(`create_day`)
   (PARTITION p20250908 VALUES [('2025-09-08'), ('2025-09-09')),
   PARTITION p20250909 VALUES [('2025-09-09'), ('2025-09-10')),
   PARTITION p20250910 VALUES [('2025-09-10'), ('2025-09-11')))
   DISTRIBUTED BY HASH(`uid`) BUCKETS 32
   ```
   
   2、insert some value
   
   ```
   insert into test_tbl values(1, 'a', 'b', '2025-09-08', '2025-09-08 
00:00:00');
   ...
   ```
   
   3、open be debug point
   
   ```
   curl -X POST 
"http://127.0.0.1:8040/api/debug_point/add/CloudSchemaChangeJob::_convert_historical_rowsets.fail.before.commit_job";
   {
       "status": "OK",
       "msg": "OK"
   }
   ```
   
   4、alter table add rollup
   
   ```
   create materialized view test_tbl_3 as  select uid, vid, pid, create_day  
from test_tbl \G;
   ```
   
   5、show alter table rollup
   
   ```
   mysql> show alter table rollup\G;
   *************************** 1. row ***************************
             JobId: 1756715448708
         TableName: test_tbl
        CreateTime: 2025-09-18 22:57:14
        FinishTime: 2025-09-18 22:57:50
     BaseIndexName: test_tbl
   RollupIndexName: test_tbl_3
          RollupId: 1756715448709
     TransactionId: 1528293360311296
             State: CANCELLED
               Msg: errCode = 2, detailMessage = rollup tasks failed on same 
tablet reach threshold 1, reason=task type: ALTER, status_code: 
DELETE_BITMAP_LOCK_ERROR, status_message: 
[(xxx.21.16.x)[DELETE_BITMAP_LOCK_ERROR]injected retryable error], backendId: 
Backend [id=1756714982495, host=xxx.21.16.x, heartbeatPort=9050, alive=true, 
lastStartTime=2025-09-18 22:34:45, process epoch=1758206085859, 
isDecommissioned=false, tags: {cloud_cluster_id=bZbcWdRS, 
cloud_unique_id=1:1756714581:yQsi7x17, cloud_cluster_status=NORMAL, 
cloud_cluster_name=tchd-dfvsacuy-plp29gys, location=default, 
cloud_cluster_private_endpoint=, cloud_cluster_public_endpoint=}], 
backendStatus: [lastSuccessReportTabletsTime='N/A', 
lastStreamLoadTime=1758206297222, isQueryDisabled=false, isLoadDisabled=false, 
currentFragmentNum=0, lastFragmentUpdateTime=1758207459008], signature: 
1756715448766
          Progress: NULL
           Timeout: 2592000
   ```
   
   6、Now the bvar fragment_executing_count is add but never reduce, leak 
happened.
   
   ```
   curl http://xxx.21.16.x:8060/vars | grep fragment_executing_count
   ```
   
   <img width="505" height="295" alt="Clipboard_Screenshot_1758207585" 
src="https://github.com/user-attachments/assets/3b83d142-a8db-4a1d-a600-ef20cd920681";
 />
   
   
   ### 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)
       - [x] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [x] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] 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