This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new c2a17b8ad9b [fix](schema-change) Fix job replay failure when 
partitions added to table after job finish (#46166) (#46367)
c2a17b8ad9b is described below

commit c2a17b8ad9b5975db2e73d4d2a74a953ba05c547
Author: Siyang Tang <[email protected]>
AuthorDate: Fri Jan 3 19:25:43 2025 +0800

    [fix](schema-change) Fix job replay failure when partitions added to table 
after job finish (#46166) (#46367)
    
    Cherry-picked from #46166
---
 .../org/apache/doris/alter/SchemaChangeJobV2.java    | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java 
b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java
index 7bf6925237d..e98d8066a11 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java
@@ -586,20 +586,20 @@ public class SchemaChangeJobV2 extends AlterJobV2 {
             } // end for partitions
             // all partitions are good
             onFinished(tbl);
-        } finally {
-            tbl.writeUnlock();
-        }
 
-        pruneMeta();
+            pruneMeta();
 
-        LOG.info("schema change job finished: {}", jobId);
+            LOG.info("schema change job finished: {}", jobId);
 
-        changeTableState(dbId, tableId, OlapTableState.NORMAL);
-        LOG.info("set table's state to NORMAL, table id: {}, job id: {}", 
tableId, jobId);
+            changeTableState(dbId, tableId, OlapTableState.NORMAL);
+            LOG.info("set table's state to NORMAL, table id: {}, job id: {}", 
tableId, jobId);
 
-        this.jobState = JobState.FINISHED;
-        this.finishedTimeMs = System.currentTimeMillis();
-        Env.getCurrentEnv().getEditLog().logAlterJob(this);
+            this.jobState = JobState.FINISHED;
+            this.finishedTimeMs = System.currentTimeMillis();
+            Env.getCurrentEnv().getEditLog().logAlterJob(this);
+        } finally {
+            tbl.writeUnlock();
+        }
 
         // Drop table column stats after schema change finished.
         Env.getCurrentEnv().getAnalysisManager().dropStats(tbl);


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

Reply via email to